how to add multiple gateways permanently in centos 6.2
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to add multiple gateways permanently in centos 6.2
I have 2 ISPs having router-IPs 172.16.1.10 & 172.16.1.253.
Server's present route is 172.16.1.10, when it goes off server should switch automatically to second one ie 172.16.1.253
If there's a single nic, I'm not sure that you can do it... Well, not without scripting up a constant icmp check to the 172.16.1.10 address, and if it fails, then have the script change a file for you.
The absolute easiest way to do it (Without setting any strange routes), I would:
cp /etc/sysconfig/network /etc/sysconfig/network.orig
vi /etc/sysconfig/network ---> Change the default gateway in here
When the gateway fails, then you can have a script to switch the two files over for you and restart the network service:
ie.
The above assumes that you haven't set up your gateways in /etc/sysconfig/network-scripts/ifcfg-eth0
It also assumes you haven't set any routes for info.
In have a single NIC, and one gateway is already defined in \etc\sysconfig\network\ifcfg-eth0 and no default gateway in \etc\sysconfig\network. still can I use your given commands
to add multiple defult gateways.
Plz. Help me.
Thanx
ssy
Quote:
Originally Posted by xenner
How many NIC's do you have?
If there's a single nic, I'm not sure that you can do it... Well, not without scripting up a constant icmp check to the 172.16.1.10 address, and if it fails, then have the script change a file for you.
The absolute easiest way to do it (Without setting any strange routes), I would:
cp /etc/sysconfig/network /etc/sysconfig/network.orig
vi /etc/sysconfig/network ---> Change the default gateway in here
When the gateway fails, then you can have a script to switch the two files over for you and restart the network service:
ie.
The above assumes that you haven't set up your gateways in /etc/sysconfig/network-scripts/ifcfg-eth0
It also assumes you haven't set any routes for info.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.