Reset network after sleep when Cisco VPN is installed

Aug 19, '03 09:21:00AM

Contributed by: raider

If you are using the Cisco VPN client 3.7.x with the GUI, you might have noticed that when it is installed, your network won't return from sleep. After having to reboot every time this happened, I got frustrated. Apparantly this problem is fixed in version 4.x of the client, but you can't get it from Cisco unless you have a Cisco support contract, and our network security guys don't want to upgrade to 4.x just yet. So aside from black hat methods, I am stuck with 3.7.2.

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 up
Most 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.

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030815150328437