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.

link|improve this question

78% accept rate
what does route-eth0 look like? – Mike Jul 11 '11 at 16:26
What did you put in route-eth0? – Massimo Jul 11 '11 at 16:26
There are many version of Centos 5.....Is this a problem in Centos 5.6? – mdpc Jul 11 '11 at 16:47
feedback

1 Answer

up vote 4 down vote accepted

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

link|improve this answer
Wrong interface, so the destination gateway was not reachable via that interface. – Kyle Brandt Jul 11 '11 at 16:48
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.