May 1, 2012

Static Route in Linux

Static Route is using for improving the overall performance of your network. Also you can use static route for implementing Sub Networks. Suppose you are having different branch office to be connected with a Head office who is linked with a T1 line , Static route will be use full.

1.To View the routes in your system

ip route show

route -n

2.Adding a route in the Linux Machine.

route add default gw 10.10.100.1 eth0

This will create a ROUTE in the interface eth0 for a gateway to 10.10.100.1

This will be lose once you restart the network. For Adding a static route , you should follow the below steps.

vi /etc/sysconfig/network-scripts/route-eth0

Append the following

10.10.1.0/8 via 10.120.194.5

This will byepass all the traffic to 10.120.194.5 router through eth0

No comments: