Friday, February 22, 2008

Adding Permanent Static Route on Linux

To add a static route to your RH box, you can use the following command:

route add -net 192.168.1.0/24 gw 192.168.2.254

If you want this route permanently added to your routing table, touch a new file in /etc/sysconfig/network-scripts

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

put the route in your file:
192.168.1.0/24 via 192.168.2.254

No comments:

Post a Comment