Basic Linux routing
Add a route to a network
#route add -net network/mask gw default-gateway
#route add -net gw
Adding default gateway
#route add default gw default-gateway
Example #route add default gw
Adding a route to specific host
#route add -host host-name gw default-gateway
 #rotue add -host gw
Deleting route to a network
#route del -network network/subnet default-gateway
#route del -net gw
Deleting default gateway
#route del default gw default-gatway
Example :
#route del default gw
Deleting specific host from routing table
#route del -host ip-add gw default-gateway
#route del -host gw
Seeing routing table
#netstat -rn
Note : The old gate way will still remain and may need to be taken out for the system to function properly. Routes are made permanent in Linux by adding routes to /etc/sysconfig/static-routes.
Posted in: Linux.
Last Modified: October 25, 2013

Leave a reply