From mboxrd@z Thu Jan 1 00:00:00 1970 From: Abraham van der Merwe Date: Tue, 19 Nov 2002 13:42:32 +0000 Subject: Re: [LARTC] help with routing determined by source address MIME-Version: 1 Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99" Message-Id: List-Id: References: In-Reply-To: To: lartc@vger.kernel.org --5vNYLRcllDrimb99 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Vincent! > > I want to route packets where the gateway is determined by the source > > address and not the destination address - is this possible with iproute= 2? > >=20 > Yes. > # When sraddr belongs to ISPA > ip rule add prio $PRIO_ISPA from $ISPA_NET lookup $ISPA_TABLE > # When sraddr belongs to ISPB > ip rule add prio $PRIO_ISPB from $ISPB_NET lookup $ISPB_TABLE > # Everything else > ip rule add prio $PRIO_DEFAULT lookup $DEFAULT_TABLE > > # Default route through ISPA > ip route add table $ISPA_TABLE default via $ISPA_GW dev $ISPA_DEV > # Default route through ISPB > ip route add table $ISPB_TABLE default via $ISPB_GW dev $ISPB_DEV >=20 > #For everything else, use a multipath route; > ip route add table $DEFAULT_TABLE nexthop via $ISPA_GW dev $ISPA_DEV > nexthop via $ISPB_GW dev $ISPB_DEV Thanks, this makes sense. I just don't understand the multipath route? Also, I take it the _TABLE variables can be arbitrary [unique] ids right? And if I want to have ISPB as the exception to the rule, I'll set ISPA's priority the highest? > > for example: > >=20 > > ISP-A ISP-B > > | | > > +---------------+ > > | linux machine + > > +---------------+ > >=20 > > default gw is ISP-A interface, but if packet comes via ISP-B, the ISP-B > > interface should be used instead of ISP-A interface >=20 > IPs used on the linux machines, are private or public IPs ? public ips --=20 Regards Abraham BEWARE! People acting under the influence of human nature. ___________________________________________________ Abraham vd Merwe [ZR1BBQ] - Frogfoot Networks P.O. Box 3472, Matieland, Stellenbosch, 7602 Cell: +27 82 565 4451 Http: http://www.frogfoot.net Email: abz@frogfoot.net --5vNYLRcllDrimb99 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.5 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE92j/I0jJV70h31dERAvh8AJ9silEpfYJAbWv6rd4F9dASb1u1wQCeL5Nt qWHGtZSGclEURtUkoFruph0= =Tj5V -----END PGP SIGNATURE----- --5vNYLRcllDrimb99-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/