CentOS 5, i manually added a static route to an ip to use the second network interface like so:

ip route add 123.456.7.89/32 via 192.168.10.101 dev eth1

is there a way to make this change be persistent upon reboot without adding it to startup script /etc/rc.d/rc.local ?

Thanks

link|improve this question
feedback

migrated from stackoverflow.com Feb 1 '10 at 13:13

This question came from our site for professional and enthusiast programmers.

1 Answer

Yes. Add the line

123.456.7.89/32 via 192.168.10.101 dev eth1

to /etc/sysconfig/netowrk-scripts/route-eth1 as shown here: http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s1-networkscripts-static-routes.html.

BTW, this was the very first hit from googling “CentOS route”

link|improve this answer
thanks, much appreciated. I did a lot of googling but it seems I skip this one, way too many tabs opened :) – Dragos Feb 1 '10 at 13:09
feedback

Your Answer

 
or
required, but never shown

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