How long is the power off period? Seconds/minutes/hours?
The capacitor (don't forget the little ones for the spikes) is to be connected to Arduino's +5V and GND pins and not to Vin, as Vin is "before" the voltage regulator.
- If the power outage lasts longer than, let's say, some minutes and could not be bridged by a very big capacitor, you should go with the rechargeable battery as recommended in my previous post.
The rechargeable battery will be always connected to your mains power supply, and is a backup, which could bridge hours of mains power outages, depending you have designed it big enough, so the battery's capacity can deliver the current needed by your project.
So, if your configuration is running at 5V and draws 100mA continuously, a 5000mAh battery can survive about 5000mAh/100mA = 50h theoretically (I would calculate with 20% less to be on the safe side - which still survives a mains power outage of 40h).
One more question:
you say you have to unplug and plug again the USB cable to wake up your ethernet shield after a power outage? So my question is:
- Is your Arduino powered through a USB cable from a PC or laptop?
- If so, I would suggest to connect the (pre-calculated) capacitors (big one plus small one in parallel) to the +5V and GND of your Arduino whether you are powering the project just via USB cable or wall outlet.
- ii might also help to buy a distortion filter which are normally used in cars to keep spikes away from electronics
One more useful link:
USB-Power and Reset Issue