Operating System - Linux
1829712 Members
2032 Online
109992 Solutions
New Discussion

Re: Linux network failover

 
Leovino A. Trinidad, Jr
Frequent Advisor

Linux network failover

Hello!

I have a linux box with two NICs of different net ID's. How do I route the packets to another if one NIC is down? Is there a script for it? I've read about the gc_timeout but some says it only works if the NIC is dead and not the hop.

Regards,

LAT
3 REPLIES 3
Al Licause
Trusted Contributor

Re: Linux network failover

Routing on linux is pretty much a manual affair as is on most unix implementations. As long as you have a route to a destination, the system will continue to attempt to send packets through that designated interface.

If your network participates in any sort of dynamic routing scheme using standard protocols, you could try to run gated which should allow dynamic updates to your routing table in the event of failures. But again if you do run gated and it is not listening for updates with the correct protocol, you may not get any updates.

Many network managers will also prevent their gateways from supplying routes to or listening to routes from anything other than trusted systems such as other gateways.

You may just need to write some sort of background job that periodically checks reachability from time to time if you suspect the 2nd nic of failure or find that critical destinations cannot be reached. This job could manually manipulate the routing table through route commands. It could get tricky.

You might want to take a look at advanced routing. It may also offer some features you may be able to implement to get around a broken network card or unreachable network.

Good luck.
Manuel Wolfshant
Trusted Contributor

Re: Linux network failover

It depends on what you wish to accomplish. A starting point is http://www.lartc.org.

Depending on your needs, you might also take a look at quagga (set of daemons for dynamic routing, including rip, ospf and bgp)

I also strongly suggest to take a DEEP dive in the documentation of the iproute2 package. It is NOT included in the package, but various sites provide excellent info. It contains a set of very powerful commands and you can accomplish almost any form of static routing with it
Leovino A. Trinidad, Jr
Frequent Advisor

Re: Linux network failover

Hello!

Thank you for your time and response. I already found out how to do it by using the linux command 'ip'... very cool... it's really a load balance/failover tool that you have to configure in the kernel...

Regards,


LAT