Linux – Add Persistent Static Route in Centos 5

centoslinuxnetworkingroute

What is the proper way to add a static route in Centos 5 that will persist rebooting?

I tired adding an route-eth0 file in /etc/sysconfig/network-scripts that contains a route , but after ./etc/init.d/network restart that route is not present and there were no errors during the restart of the service.

Best Answer

That's indeed the right place to add it (if the route is actually reachable via eth0), as documented here:

http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s1-networkscripts-static-routes.html