Networking Failover - in- and out-going traffic
Hi I'm trying to set up network failover on machines with multiple nics. I found some solutions too, but I'm not quite satisfied yet.
Let's say I have two nics with ip-adresses (eth0) 10.0.0.1 and (eth1) 10.0.0.101 and a default gateway 10.0.0.254
For outgoing traffic I can add the default gateway for the routing tables for both nics
route add default gw 10.0.0.254 dev eth0
route add default gw 10.0.0.254 dev eth1
and set the number of seconds before trying another line
echo 10 > /proc/sys/net/ipv4/route/gc_timeout
But I seems like the system takes a little more time than the 10 seconds I specify to switch to the other nic. Could I get a faster switch somehow?
For incoming traffic I have set up a DNS record for both ips - translating "myserver.dk" into both 10.0.0.1 and 10.0.0.101. Works fine when both nics are up and balances the load also. But what about one nic is failing? I guess the dns server don't experience that and will keep spamming a bad ip every other lookup (as the first in the list). Will clients automatically try the next ip if they get the bad one first?
Best regards
Mads Jakob
|