From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Rabbitson Date: Thu, 21 Jun 2007 15:35:13 +0000 Subject: Re: [LARTC] Redundant internet connections. Message-Id: <467A9AB1.4090902@rabbit.us> List-Id: References: <467A2354.1070805@riverviewtech.net> In-Reply-To: <467A2354.1070805@riverviewtech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Grant Taylor wrote: > I need a way for the Linux kernel to try to use a default gateway and > switch to another one if it does not see any traffic. I don't know about any working in-kernel solutions, but you can do it trivially with netfilter and a cronjob: * In netfilter do this: -t mangle -N ispA -t mangle -A ispA -j RETURN -t mangle -N ispB -t mangle -A ispB -j RETURN -t mangle -A PREROUTING -i $ifA -s ! a.a.a.a/aa -j ispA -t mangle -A PREROUTING -i $ifB -s ! b.b.b.b/bb -j ispB where a.a.a.a and b.b.b.b are subnets describing your first 1 - 2 hops, so traffic from your upstream router will not count. * Then make a cron job that run this every minute: iptables -t mangle -vnxZL isp[AB] and will look for the first number on the third line. If it is not 0 - the link is alive, otherwise change the routing tables accordingly. Of course you can have up to 1 minute of downtime, but it does not look so bad IMO. HTH Peter _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc