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.
migrated from stackoverflow.com Dec 6 '11 at 23:45
This question came from our site for professional and enthusiast programmers.
route delete default
route add default 192.168.0.1
route change default -interface $INTF
route change 192.168.0.0/16 -interface $INTF
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.