All of lore.kernel.org
 help / color / mirror / Atom feed
* [OT] ipv4: how to choose src ip?
@ 2002-12-05 19:00 Tomas Szepe
  2002-12-05 20:37 ` Richard B. Johnson
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tomas Szepe @ 2002-12-05 19:00 UTC (permalink / raw)
  To: lkml

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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-12-06 15:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-05 19:00 [OT] ipv4: how to choose src ip? Tomas Szepe
2002-12-05 20:37 ` 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

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.