Aug 19, '03 09:21:00AM • Contributed by: raider
If you lose your network after waking from sleep, here is an easier way to get it back than a reboot. Run these two commands in Terminal (or your favorite terminal application):
sudo ifconfig en0 down sudo ifconfig en0 mtu 1500 upMost Macs with one network card should have their card at en0. If your card is not at en0, substitute which interface you want to reset. I am assuming that if you have multiple ethernet interfaces, you can figure out which one is which.
Also, the MTU setting *could* be different for you. 1500 is the default, but who knows what your ISP or network guys or yourself might have set. So if you are concerned you can just type ifconfig en0, which will spit out your current network configuration. Somewhere in there, usually near the end of the first line, you will see your MTU setting, and you can adjust the above commands to set it back to that same value.
I am sure that you could wrap all this into an AppleScript application or something. For some reason, turning the interface off and back on again from within System Preferences doesn't do the trick.
