I would recommend you accomplish this with the networksetup utility from the command line. You can set it to add persistent static routes for individual network profiles. I used it to successfully accomplish exactly what you're talking about for both my 'Home - Docked' network location, and my 'Home - Wifi' location. Be careful that you do not have hyphens in the network service name that you're adding the routes into - it doesn't seem to 'like' that (the network locations name doesn't seem to matter much, however).
To print the routing table on a Mac OS X computer, you must open a Terminal window. Terminal can be found by opening the Finder, selection Applications and Utilities. To open a terminal session, double-click on 'Terminal.app'. Inside the Terminal application, the route print command is 'netstat -nr'.
Route Add For Mac Computers
- Oct 02, 2016 Adding a route manually can be necessary sometimes. When on Linux, I know the command by head: 1. Sudo route add -net 10.67.0.0 /16 gw 192.168.120.254. On the Mac the command is similar, but a bit different ? Just as a note to myself and anyone else interested: 1. Sudo route -n add -net 10.67.0.0 /16 192.168.120.254.
- To add a route to the routing table use the route add command. An example looks like this: route add 10.0.0.0 mask 255.0.0.0 192.168.177.1. You can optionally add a metric 2 to the end if you want to add a specific weight to the route. The routes with the lowest metric will take precedence over higher metrics.
- List persistent routes on 'device' of choice i.e. 'Ethernet' networksetup -getadditionalroutes Ethernet. Add your route to 'Ethernet' sudo networksetup -setadditionalroutes Ethernet 192.168.1.0 255.255.255.0 10.0.0.2. List persistent routes on 'Ethernet' again to check; networksetup -getadditionalroutes Ethernet. To see all commands: networksetup -help.
- Here's a link for you to check out: http://www.marcoach.nl/persistent-static-routes-on-os-x/
- Also, from a terminal window: 'man networksetup' gives you all the usage info you'll need.
Hope that helps!
Route Add Mac Permanent
Best,
Route Add For Macbook Pro
Pete