booniedog
08-04-2006, 01:51 AM
Hi,
I've been searching all over and can't find many info on doing an ip failover for stand alone servers whether it be mail/www. I'm not fimiliar with network config in Linux so I might be doing something wrong and need help.
I have 2 nics on 1 server and 2 isp with 2 routers-1 isp for each router. How can I configure it so if eth0 with isp1 fails, it'll auto switch to eth1 with isp2? If it's possible, I would like to also make it so eth0 is for incoming and eth1 for outgoing at the same time still have the failover and if this will not cause complications.
I've found 1 article on doing only auto failover for something like a proxy server with 2 wan and 1 lan. I tried using only the part for the 2 wan section but it's not working. Here's what I did.
I configured eht0 to isp1 static ip with their gw and eth1 to isp2 static ip with their gw.
I enabled IP forwarding by changing the value of net.ipv4.ip_forward to 1 in the /etc/sysctl.conf. I probably didn't need to do this but I'm not sure.
I added "route add default gw xxx.Public.IP.xxx dev eth0" and same for eth1 to the /etc/rc.d/rc.local file.
I modified the /proc/sys/net/ipv4/route/gc_timeout file from 300 to 10.
After I rebooted, everything was working as if only one is avail. I even checked to make sure that eth1 was enabled during bootup and is active and it was. But when I disconnect eth0, eth1 doesn't kick in even after 2 minutes.
The aricle that I got this from said that after these configs, I now have a failover router. I didn't have it configed as a router so I turned on the routing feature and it was worse, I have no internet connection unless I deactivate eth1 so I disabled the routing feature but the damage was done so now I have to disable eth1 in order for eth0 to work.
So now I'm back at square 1 but worse. At least before, I can have both activated and eth0 will still work, just not failover.
I apprciate it if anyone can help me.
I've been searching all over and can't find many info on doing an ip failover for stand alone servers whether it be mail/www. I'm not fimiliar with network config in Linux so I might be doing something wrong and need help.
I have 2 nics on 1 server and 2 isp with 2 routers-1 isp for each router. How can I configure it so if eth0 with isp1 fails, it'll auto switch to eth1 with isp2? If it's possible, I would like to also make it so eth0 is for incoming and eth1 for outgoing at the same time still have the failover and if this will not cause complications.
I've found 1 article on doing only auto failover for something like a proxy server with 2 wan and 1 lan. I tried using only the part for the 2 wan section but it's not working. Here's what I did.
I configured eht0 to isp1 static ip with their gw and eth1 to isp2 static ip with their gw.
I enabled IP forwarding by changing the value of net.ipv4.ip_forward to 1 in the /etc/sysctl.conf. I probably didn't need to do this but I'm not sure.
I added "route add default gw xxx.Public.IP.xxx dev eth0" and same for eth1 to the /etc/rc.d/rc.local file.
I modified the /proc/sys/net/ipv4/route/gc_timeout file from 300 to 10.
After I rebooted, everything was working as if only one is avail. I even checked to make sure that eth1 was enabled during bootup and is active and it was. But when I disconnect eth0, eth1 doesn't kick in even after 2 minutes.
The aricle that I got this from said that after these configs, I now have a failover router. I didn't have it configed as a router so I turned on the routing feature and it was worse, I have no internet connection unless I deactivate eth1 so I disabled the routing feature but the damage was done so now I have to disable eth1 in order for eth0 to work.
So now I'm back at square 1 but worse. At least before, I can have both activated and eth0 will still work, just not failover.
I apprciate it if anyone can help me.