Add or delete static routes Apple Mac OS X Mountain Lion

Well this is most of the time easy but useful when need and you can’t remind the command you have to use to add a static route in a Mac OS X Mountain Lion installation. ( Beside the command can be used to older Mac OS X version also 🙂 )
Open fist the terminal session.
Use the following command: ” sudo route -n add x.x.x.x/24 x.x.x.x ( like the example below )”  You have to enter your password.

To delete a route you have to use the following command:
” sudo route -n delete x.x.x.x/24 x.x.x.x ”

 
To view you route table on you Mac you use the following command:
” netstat -nr ”

4 thoughts on “Add or delete static routes Apple Mac OS X Mountain Lion”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: