Re: multiple default routes

From: Andi Kleen (ak@suse.de)
Date: Wed May 31 2000 - 10:45:14 EST


Helge Hafting <helgehaf@idb.hist.no> writes:

> >
> >
> > 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?"
>
> IP don't work that way, as far as I know. Information about wich
> interface received a packet is removed early, it is not in the
> IP headers. (Firewall code like ipchains may have access to this
> information,
> but I don't think that is useful for your purpose.)

Actually Linux preserves that information. For datagram sockets you
can easily get it via the IP_PKTINFO control message. For TCP it is
a bit more complicated. The stack does not react to this information
per default (only when the packet contains source routing options), but
the user program could. The kernel could be made too. The question is
just if it makes sense. It usually doesn't.

-Andi

-
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