From: Tomas Szepe <szepe@pinerecords.com>
To: lkml <linux-kernel@vger.kernel.org>
Subject: [OT] ipv4: how to choose src ip?
Date: Thu, 5 Dec 2002 20:00:54 +0100 [thread overview]
Message-ID: <20021205190054.GE23877@louise.pinerecords.com> (raw)
Hi,
I apologize for a vigorously off-topic post; Google groups just ain't
helping me this time.
Suppose I have two IP addresses from the same subnet on the same
interface, and this interface also happens to be what my default
gateway is on, like so:
/sbin/ifconfig eth1 213.168.178.209 netmask 255.255.255.192 \
broadcast 213.168.178.255
/sbin/ifconfig eth1:0 213.168.178.210 netmask 255.255.255.192 \
broadcast 213.168.178.255
/sbin/route add default gw 213.168.178.193
The question is, how does the IP stack decide what source IP address
it should use when there's a packet to be sent on the given subnet or
via the defaultgw? Is there any way to actually choose the source IP
address manually (say, per outgoing connection)?
I'm not interested in rewriting the source address with netfilter based
on destination and/or service; What I'm looking for is rather a way to
initiate two connections to the same destination host using the two
different source IP addresses.
--
Tomas Szepe <szepe@pinerecords.com>
next reply other threads:[~2002-12-05 18:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-05 19:00 Tomas Szepe [this message]
2002-12-05 20:37 ` [OT] ipv4: how to choose src ip? Richard B. Johnson
2002-12-05 20:56 ` Brad Hards
2002-12-05 21:38 ` Tomas Szepe
2002-12-06 4:25 ` Ben Greear
2002-12-06 9:06 ` Andrew McGregor
2002-12-06 15:13 ` Richard B. Johnson
2002-12-05 20:58 ` Willy Tarreau
2002-12-05 21:39 ` Tomas Szepe
2002-12-06 15:27 ` Mark Frazer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021205190054.GE23877@louise.pinerecords.com \
--to=szepe@pinerecords.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.