Fluitend door het leven

Osx Routing
I've been using a Macbook Pro for more than a year now and it is mostly a satisfying experience.
I love the fact that sleeping and waking up works like a charm.
Bad experiences with Windows in the past and a lot of bad experiences with some GNU/Linux-distributions made me hesitant to use that function.

Our company uses OpenVPN to create a secure tunnel to our office.
My notebook is, where possible, attached to a network via ethernet.
When resuming from sleep and using Wifi, Tunnelblick (and sometimes Outlook) doesn't work on OS X and reconnecting is not possible. Changing from Wifi to ethernet has the same issues.
This failure to use VPN in OS X when necessary is a big nuisance since the day I found out about the problem. To resolve this I restarted the notebook and with that I have issues ;-)

The solution is something I found yesterday and have immediately put together in a shell-script to ease the changes in network-environments.

I hope this helps somebody who has the same problems!

The shell script:
#!/bin/sh
echo 'flush route'
sudo route -n flush
# repeat for better result
sudo route -n flush
sudo route -n flush

echo 'restart networking'

echo 'restart ethernet'
sudo ifconfig en0 down
sudo ifconfig en0 up

echo 'restart wifi'
sudo ifconfig en1 down
sudo ifconfig en1 up

echo 'Done resetting network'
Have fun!
Menno    Werk ^^