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 <tatooin@kelkoo.com> Kelkoo.com - Security Manager _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/