Adding Routes in OSX

It’s surprisingly frustrating to add new routes to your networking configuration on OSX as the syntax is similar but slightly different from Linux. The correct format for OSX is:

sudo route -n add -net <range> <gateway> <mask>

so, for example:

sudo route -n add -net 192.168.32.0 192.168.2.1 255.255.224.0

To make sure your changes took effect print the entire routing table:

netstat -rn
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s