Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
SDN 101: An Introduction to Software Defined Networking
Discover the advantages of SDN.
SDN has quickly become one of the hottest trends in IT. But not all SDN solutions offer real software-defined functionality. As more enterprises consider SDN, they want to know, “What is SDN? And what are the real benefits?” If you're ready to explore the advantages of SDN, and want to know how it should be implemented within your enterprise, start by reading our introductory white paper.
Click Here to receive this Complete Guide absolutely free.
I agree with ComputerErik, the correct way would be to use standard scripts.
Anyway, if you do a script which is supposed to be run during boot sequence, always use full path, I mean you should specify "/sbin/route", because nothing guarantee you that PATH is correctly set during boot.
Actually my servers has two NICs and both NICs have been assigned IP addresses and default gateways. Linux by default picks only one default gateway and puts it in routing table which can be viewed in 'route -n' command. Now purpose of dual NICs and IPs is that if one NIC or even router gets down then traffic will be received using send NIC or router and after processing send traffic back to router.
I have defined default gateways of both NICs using scripts placed at /etc/sysconfig/network-scripts/ but only one default gateway is used by linux and if that gateways gets down then traffic can't be sent from the server. Now if I execute command route add default gw 192.168.0.1 netmask 0.0.0.0 dev eth3 then it puts second default gateway in routing table and this way I can achieve redundancy. I hope now my requirement is clear so please suggest me how can I automate above command on startup/boot time.
Ok, I think that this link may help you: http://www.cyberciti.biz/faq/setting...terfaces-file/
I think that if I were you, I would try to "play" with "post-down command" stuff to change the default gateway when an interface comes down. As I have never tried I cannot assert it will work, but it is from my point of view the cleanest way to proceed.
Sorry but unfortunately, I have never used Centos and barely never used Fedora (I think that they are quite similar)... So I cannot help you more.
Maybe have a look at /etc/sysconfig/network-scripts/ directory and ifup-routes file... the best would be to create a similar file named ifdown-routes to change your gateway when an interface bvrings down.