Route ADD 192.168.35.0 MASK 255.255.255.0 192.168.0.2. If you were to use the route print command to look at the table now, you’d see your new static route. That’s all easy enough, but there is one extra little catch. When you add a static route, by default it only lasts until the next time you start Windows.
I am familiar with the route add default gw command in Linux to add a default gateway, but this doesnt work on Mac OS. I cant find any appropriate example in the route manual. Can anyone help me the command.
bmike♦This question came from our site for professional and enthusiast programmers.
Go to System Preference >> Network, and you can 'Set Service Order' of the network interfaces and effectively change the default route order in the routing table.
If you are intent on using route
the man page for route will show you it's the same as most BSD route commands. You may need ip6config
(and man page) as well if you care about IPv6 routing.
The 'mac' way is to set it from the System Preference pane under network and is preferred over using unix commands since it honors location changes and other events such as a reboot.
bmike♦