[888] in linux-net channel archive

home help back first fref pref prev next nref lref last post

multiple IP addresses, outgoing connections

daemon@ATHENA.MIT.EDU (Stephen R. van den Berg)
Sat Aug 12 14:30:53 1995

From: srb@cuci.nl (Stephen R. van den Berg)
Date: Sat, 12 Aug 1995 14:27:37 +0200
To: linux-net@vger.rutgers.edu

If you have multiple real interfaces on a box, and you make a connection
from that machine to another machine, then the sender-IP address will usually
be the one that the interface has the connection went out on (i.e. it depends
on the routing table in the kernel).

Now, if you have one ethernet connection, but have multiple IP addresses
(like by using dummy interfaces), there seems to be no way to coerce the
kernel/programs into automatically selecting a certain sender address
depending on where you'd like to connect.

What I tried:

ifconfig dummy my.2nd.ip.address
route add -host some.remote.host dummy

Thus, I hoped that a "telnet some.remote.host" would result in a sender
IP address of "my.2nd.ip.address".  But, alas, it doesn't (current effect
of this is that the packets don't leave my machine at all).

Is there something I'm missing here that allows this to be accomplished?
What about the IP-alias patches, would they allow for this?

What if I would patch the kernel to allow this to work (which would
probably involve making some kind of tunnel-link from the dummy device to
the actual outgoing device, eth0 in this case)?  Any pitfalls I should
watch out for?  Anybody have any better ideas?
-- 
Sincerely,                                                          srb@cuci.nl
           Stephen R. van den Berg (AKA BuGless).

Be braver.  You cannot cross a chasm in two small jumps.

home help back first fref pref prev next nref lref last post