Re: multiple default routes

From: Matt Kemner (kemner@live.wasp.net.au)
Date: Wed May 31 2000 - 04:03:31 EST


> > I have 2 NICs on each of my Linux boxes connected to 2 different
> > network segments and routers and I would like packets coming on one
> > ethernet interface (from any source ip) to go back over the same
> > interface. Is that possible in Linux ?
>
> You probably mean something like "*answers* to incoming packets
> should go out via the interface the packet came in?"

I did something similar with policy routing.

I had a gre tunnel set up for my machine, and set up the routing so that
any packets originating from the machine with source address of the
tunnel, would be sent out via the tunnel - which is probably what the
person that posted the above message wants.

All I needed to do was a simple:

ip rule add from $tunnel_local_ip table 1
ip route add 0/0 table 1 dev gre1

As a result if someone accessed eg. webpages via the tunnel interface, the
reply would be sent via gre1. If webpages were accessed through the normal
ethernet, packets would be sent back via the normal default route.

 - Matt

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:27 EST