jasonnixon.net - quick reference - route


examples generated with route 1.98 (2001-04-15) on Jolicloud robby (based on Ubuntu 9.04)
some examples copied from the route man page

route -n
display routing table, use numerical addresses instead of trying to determine symbolic host names

route add -net 127.0.0.0 netmask 255.0.0.0 dev lo
adds the normal loopback entry, using netmask 255.0.0.0 and associated with the "lo" device (assuming this device was previously set up correctly with ifconfig(8)).

route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
adds a route to the local network 192.56.76.x via "eth0". The word "dev" can be omitted here.

route add -net 10.0.0.0 netmask 255.0.0.0 gw 172.22.22.1
adds a route to the network 10.0.0.0 via the gateway 172.22.22.1

route del default
deletes the current default route, which is labeled "default" or 0.0.0.0 in the destination field of the current routing table.

route add default gw 192.168.1.1
adds a default route (which will be used if no other route matches) of 192.168.1.1

route add -net 10.0.0.0 netmask 255.0.0.0 reject
installs a rejecting route for the private network "10.x.x.x."




Valid HTML 4.01 Transitional Valid CSS!