incorrect source address for local TCP connections?

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

 



eth0 has two addresses within the same network. Link scope route has a
src= specifying the first IP address. However, when doing a connect to
one of the IP addresses on eth0 from the machine itself (unbound socket)
the source address ends up identical to the destination address, not to
the src= in the route.

Is this a feature or a bug?


Example:

ip addr:
	1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
	    link/ether 00:13:72:12:39:3f brd ff:ff:ff:ff:ff:ff
	    inet 172.17.1.48/16 brd 172.17.255.255 scope global eth0
	    inet 172.17.2.93/16 scope global secondary eth0
ip route:
	172.17.0.0/16 dev eth0  proto kernel  scope link  src 172.17.1.48 
	default via 172.17.1.118 dev eth0  proto zebra  metric 2 

When doing a

	nc <anyhost> discard

then <anyhost> sees a connect originating from 172.17.1.48. This is
correct. However, when connecting to the second IP address as in

	nc 172.17.2.93 discard

a TCP connection is created originating from 172.17.2.93 instead of
from 172.17.1.48

-- 
Frank
-
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

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

  Powered by Linux