From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Jaussaud Date: Tue, 19 Nov 2002 13:36:08 +0000 Subject: Re: [LARTC] help with routing determined by source address Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org On Tue, 2002-11-19 at 13:11, Abraham van der Merwe wrote: > Hi! > Hi, > I want to route packets where the gateway is determined by the source > address and not the destination address - is this possible with iproute2? > 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 Then; # 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 #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 > for example: > > ISP-A ISP-B > | | > +---------------+ > | linux machine + > +---------------+ > > 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 IPs used on the linux machines, are private or public IPs ? Cheers, Vincent. -- Vincent Jaussaud Kelkoo.com - Security Manager _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/