From: Alex Samad Date: Thu, 21 Jun 2007 21:01:01 +0000 Subject: Re: [LARTC] Redundant internet connections. Message-Id: <20070621210101.GB31479@samad.com.au> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0161035336==" List-Id: References: <467A2354.1070805@riverviewtech.net> In-Reply-To: <467A2354.1070805@riverviewtech.net> To: lartc@vger.kernel.org --===============0161035336== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 21, 2007 at 05:35:13PM +0200, Peter Rabbitson wrote: > Grant Taylor wrote: >=20 > >I need a way for the Linux kernel to try to use a default gateway and=20 > >switch to another one if it does not see any traffic. should something like this work=20 default proto static metric 5 nexthop via 58.173.108.1 dev vlan2 weight = 10 nexthop via 10.20.20.106 dev ppp0 weight 20 and then let the dgd detect dead gateways and drop the relevant route about. >=20 > I don't know about any working in-kernel solutions, but you can do it=20 > trivially with netfilter and a cronjob: >=20 > * 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 >=20 > where a.a.a.a and b.b.b.b are subnets describing your first 1 - 2 hops,= =20 > so traffic from your upstream router will not count. >=20 > * 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 -=20 > the link is alive, otherwise change the routing tables accordingly. >=20 > Of course you can have up to 1 minute of downtime, but it does not look= =20 > so bad IMO. >=20 > HTH >=20 > Peter > _______________________________________________ > LARTC mailing list > LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc >=20 --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGeucNkZz88chpJ2MRAmYAAJ93UTCA5Myudi/OftNQgVXD8LKL3QCgqe8L yJxIh0CEPxGsvfB+bSM10us= =Bx3o -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd-- --===============0161035336== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --===============0161035336==--