OS X and split-tunnel VPN

KM on 2004-07-01T14:14:22

I connect to a VPN, and sometimes have an issue. When the VPN gets disconnected for some reason (not because I disconnected it), my default gateway route seems to change to something I don't want.

Here is what I have in my /etc/ppp/ip-up:

/sbin/route delete default ip.of.the.vpn
/sbin/route add default 192.168.1.1
/sbin/route add XXX.XXX.0.0 ip.of.the.vpn
/sbin/route add NN.NNN.0.0/16 ip.of.the.vpn

When I connect, this is fine. All my VPN traffic goes through the VPN, and uses all things VPN. And, when I connect to the rest of the world, it works fine. So, it's a split-tunnel.

And, my ip-down:

/sbin/route add XXX.XXX.0.0
/sbin/route delete NN.NNN.0.0/16
/sbin/route add default 192.168.1.1

When I disconnect by hand, this works fine. I could probably have nothing in this file, but do.

But, those random disconnects (and reconnect) seem to sometimes make my default gateway the ip.of.the.vpn. I don't notice until Adium suddenly disconnects, and I do a netstat to look at the routing table... then I have to run ip-up by hand.

Anyone have any suggestions?