0

I have two IPs assigned to the same interface (host A):

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether a4:bf:01:24:f8:7c brd ff:ff:ff:ff:ff:ff
inet 10.10.200.22/24 brd 10.10.100.255 scope global eth1
   valid_lft forever preferred_lft forever
inet 10.10.200.155/32 scope global eth1
   valid_lft forever preferred_lft forever

and some service listening on 10.10.200.155:80. When I'm trying to telnet port 80 the connection is hanging (source address 10.10.201.2, host B). tcpdump on host A shows me sth like this (repeating):

# tcpdump -n -i any dst 10.10.200.155
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
21:52:16.894558 IP 10.10.201.2.60262 > 10.10.200.155.80: Flags [S], seq 1239565567, win 29200, options [mss 1460,sackOK,TS val 1965969834 ecr 0,nop,wscale 7], length 0
21:52:17.893363 ARP, Request who-has 10.10.200.155 tell 10.10.200.155, length 28
21:52:17.893732 IP 10.10.201.2.60262 > 10.10.200.155.80: Flags [S], seq 1239565567, win 29200, options [mss 1460,sackOK,TS val 1965970084 ecr 0,nop,wscale 7], length 0
21:52:18.893319 ARP, Request who-has 10.10.200.155 tell 10.10.200.155, length 28
21:52:19.893374 IP 10.10.200.155 > 10.10.200.155: ICMP host 10.10.201.2 unreachable, length 68
21:52:19.893385 IP 10.10.200.155 > 10.10.200.155: ICMP host 10.10.201.2 unreachable, length 68
21:52:19.893393 IP 10.10.200.155 > 10.10.200.155: ICMP host 10.10.201.2 unreachable, length 68
21:52:19.893400 IP 10.10.200.155 > 10.10.200.155: ICMP host 10.10.201.2 unreachable, length 68
21:52:19.897746 IP 10.10.201.2.60262 > 10.10.200.155.80: Flags [S], seq 1239565567, win 29200, options [mss 1460,sackOK,TS val 1965970585 ecr 0,nop,wscale 7], length 0

Some communication reaches 10.10.200.155 but there are strange(?) ARP requests from 10.10.200.155 asking for itself, is it ok? There is no other traffic in background so all those packets are generated on telneting. On host A tcpdump shows nothing for tcpdump -n -i any dst 10.10.201.2. Routes for those addresses:

10.10.200.0/24 dev eth1  proto kernel  scope link  src 10.10.200.22 
10.10.201.2 via 10.10.200.155 dev eth1

Do you have any idea why traffic can't pass back to 10.10.201.2?

3 Answers3

0

Your second IP seems wrong. You are assigning another IP with a different subnet mask (/32).

Assign a secondary IP with the same subnet mask. You have examples here in the comment: Persist IP address alias across reboots in CentOS/RHEL 6 using "ip" command

mr4kino
  • 101
  • 2
0

Looks like I found some temporary workaround. After adding new IP to the interface I have to flush related route and add it one more time.. Then communication works perfectly. Does anyone know why it happen like this?

0

I had this happen to me in a slightly different way, the root cause was a mistake in my 'ip route add' command, instead of doing 'ip route add via <remote gateway IP address> dev <local interface>' I did 'ip route add via <local interface IP address> dev <local interface>'. I'm not saying that's your issue but just check.