I have set up OpenVPN on our pribvate network, but our special setup requires manually adding a static entry to the routing table of computers that we want to access from the outside via our VPN server. In SuSE Linux this is a nobrainer as Yast provides a section where to add static routing information. On MacOS X the command line works, but upon reboot the route is lost:
route add 10.8.0.0/24 192.168.0.2
Check what the route is for a specific IP:
route get 10.8.0.1
The same command has a different syntax on Linux though:
route add -net 10.8.0.0 netmask 255.255.255.0 gw 192.16
In order to preserve the routing information over a reboot I created the folder AddRoutes in /Library/StartupItems. Inside this folder there have to be two files: AddRoutes and StartupParameters.plist . The content of these files is the following:
# Set up static routing tables
ConsoleMessage "Adding Static Routing Tables"
route add -net 10.8.0.0/24 192.168.0.2
Description = "Add static routing tables";
Provides = ("AddRoutes");
Requires = ("Network");
OrderPreference = "None";
These files need to be readable and executable by everybody for MacOS X 10.4.7. However, MacOSX might wipe these files with each system upgrade (at least from Mountain Lion to Mavericks my settings disappeared completely). After recreating them, I got the error message "Insecure Startup Item disabled" at boot and I needed to give the directory and the files the following permissions to make the error to disappear:
drwxr-xr-x 4 root wheel 136 Aug 6 22:44 AddRoutes
-rwxr-xr-x 1 root wheel 238 Aug 6 22:43 AddRoutes
-rwxr-xr-x 1 root wheel 123 Aug 6 22:44 StartupParameters.plist
However, the route does not get added in Mavericks by this procedure and I could not find any information how to do this.
The original information is from the following website: http://macosx.com/forums/showthread.php?t=267209.