local IP collision with remote IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


I have a number of Ethernet interfaces on a box running a 2.6 kernel
and want to be able to configure IP addresses arbitrarily on these
interfaces and talk to arbitrary remote hosts using them.  My basic
approach is to bind TCP sockets to different source IP addresses
(based on the interface I want to go out) and use source-based routing
and NAT.  This almost works -- I can have the same subnet on all
interfaces and remote hosts and it all works properly.

I am having issues when the IP address on one of the interfaces
collides with an IP address I want to talk to on another interface,
however.  What I see is that the TCP SYN gets an immediate RST back.
The frame is never leaving the box so I presume there is some sort of
local routing issue.

Am I having issues because of the "local" routing table?  The output
of "ip rule list" makes me think that the local table has priority
over my source-route tables:

0:	from all lookup 255 
32764:	from 198.18.0.101 lookup TAP1 
32765:	from 198.18.0.100 lookup TAP0 
32766:	from all lookup main 
32767:	from all lookup default 

Looking at the local table I see the following (among other things):

broadcast 10.10.10.0 dev tap0  proto kernel  scope link  src 10.10.10.10 
broadcast 10.10.10.0 dev tap1  proto kernel  scope link  src 10.10.10.20 
broadcast 10.10.10.255 dev tap0  proto kernel  scope link  src 10.10.10.10 
broadcast 10.10.10.255 dev tap1  proto kernel  scope link  src 10.10.10.20 
local 10.10.10.10 dev tap0  proto kernel  scope host  src 10.10.10.10 
local 10.10.10.20 dev tap1  proto kernel  scope host  src 10.10.10.20 

If I want to talk to 10.10.10.10 using the 10.10.10.20 interface, is
my issue that the kernel is seeing 10.10.10.10 in the local table and
never going any further?

Joe Buehler


--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Photo]     [Yosemite]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]     [Video 4 Linux]     [Linux Resources]

Add to Google