Tuesday, August 7, 2012

OSX VPN Add route on connection

On OSX, you can automatically add a route when the VPN is connected:

In the terminal:


sudo nano /etc/ppp/ip-up
Add the lines:



#!/bin/sh
/sbin/route add 10.0.1.0/24 -interface $1



WHERE, 
10.0.1.0/24
 is the subnet you want to route to. The $1 will automatically be populated with the correct interface name.

Add as many routes as required.

Save and exit


sudo chmod a+x /etc/ppp/ip-up



Connect to your VPN, and you route should be created.

No comments:

Post a Comment