Configuring Persistent static route in Linux

Configuring Persistent static route in Linux

Static routes will be added usually through “route add” command. The drawback of ‘route’ command is that, when Linux reboots it will forget static routes. But to make it persistent across reboots, you have to add it to /etc/sysconfig/network-scripts/route-<eth> .

To add static route using “route add”:

# route add -net netmask gw dev eth0

Adding Persistent static route:

You need to edit /etc/sysconfig/network-scripts/route-eth0 file to define static routes for eth0 interface.



Save and close the file. Restart networking:

# service network restart

Verify new routing table:

# route –n

# netstat –nr


Leave a Reply

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

8 + nine =

This site uses Akismet to reduce spam. Learn how your comment data is processed.