Possible to configure OS X VPN to split traffic between VPN and local interface?

jph picture jph · Sep 13, 2010 · Viewed 21.4k times · Source

I'm using the built-in OS X VPN tool to connect to my company's network. I notice that, when I'm connected, all traffic goes over the VPN.

In the past when I've used the Windows VPN tool I was able to configure it such that only traffic to certain IP ranges and/or host names went over the VPN and everything else went over the local network.

Is that possible with a default OS X VPN? I don't see anything in the settings...

Answer

kiteloop picture kiteloop · Nov 3, 2010

Yes, this is possible. First, you have to remove the checkmark from "Send all traffic over VPN connection" in Settings -> Network -> Your VPN -> Advanced.

Then, from the Terminal you can use "route" to add specific hosts that should be routed via your VPN.

sudo /sbin/route add -host pandora.com -interface ppp0

In this example, "pandora.com" is the host that should be routed via the VPN and ppp0 is the name of the VPN network interface (ifconfig shows you the list of network interfaces).