automatic switching route
Hi all,
I have a debian installed as firewall with 2 nic and 2 ISP ( and 2 modems of course ) :
10.0.0.0/24 LAN eth0
and
195.*.*.*/252 WAN eth1
Note * for privacy.
I am setting up a failover router so if the first route doesn't work ( power down, connectivity issues on first modem ) it could automatically switch on the other route.
All clients are behind eth0 and masquerading is set up as well on eth0 and eth1.
Actually the default route is 195.*.*.* via eth1.
The second route I want to add is 10.0.0.250 via eth0.
I set up like that:
195.*.*.0 0.0.0.0 255.255.255.192 U 0 0 0 eth1
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 195.*.*.* 0.0.0.0 UG 0 0 0 eth1
0.0.0.0 10.0.0.250 0.0.0.0 UG 0 0 0 eth0
As you can see the first default gw is my preferred route and my second one is 10.0.0.250
I echoed 5 as seconds for timeout on the first route.
echo 5 > /proc/sys/net/ipv4/route/gc_timeout
and
sysctl -p
If I try to power down my first gw ( my first route ) it doesn't switch automatically.
BUT if I remove the default gw via "route del" it works, maybe because it takes the second route in order, and not because it switches successfully.
Thanks in advance.
Tommaso
Last edited by gettons1980; 06-23-2008 at 06:34 AM.
|