MacOS – OS X El Capitan – Cisco Built-in VPN client – split traffic

macosNetworkvpn

On OS X 10.11 (El Capitan), with the Cisco Built-in VPN client, I would like to configure the route table in order to have the following thing :

  • subnet traffic 192.168.101.0/24 goes through the VPN
  • everything else (196.168.1.0/24 my local network, and all the internet) goes through en0, and not through the VPN

Is there a way to configure it with some tricky route add|change|delete commands?
Moreover is there a way to run this commands every time I connect to the VPN.

Best Answer

For the first part (how to split traffic), I had the solution with the two following code lines

sudo route add -net <REMOTE_SUBNET> -iface utun0
sudo route change default <LOCAL_GATEWAY_IP>