mac routing – add new route

Sometimes you do net get an IP automatically. But this is not a big problem. You can add IP addresses and routes manualy.

You can use the “Network Manager” –>¬† “Open Network Prefereneces”

But I prefer the shell commands.
Verify that you can access the corresponding  external / internal routing interface and add a route to that specific network:

Adding a specific host route:

sudo route add -host 192.10.2.100 192.168.1.254

Adding a specific network route:

sudo route add -net 192.168.2.0 192.168.1.254 -netmask 255.255.255.0

You see that the syntax is turned:

route add [-net|-host] [TARGETIP] [GATEWAY] -netmask [SUBNET]

To see the routing table

netstat -rvn

Remember to add a host / net route on the corresponding client as well if it is not handled by the default gateway.

1 comment for “mac routing – add new route

  1. World War Z Online
    July 1, 2013 at 18:31

    Hi, every time i used to check weblog posts here early in the daylight, because i love
    to gain knowledge of more and more.

Leave a Reply

Your email address will not be published. Required fields are marked *