3

I have a setup in which I have two hosts (A and B) connected between them. Each host has got a 4-port Network Interface Card (NIC). When I configure all eight interfaces to belong to the same subnet and I ping, for example, from port 1 of host A to port 1 of host B, it does not work. Capturing traffic through those interfaces shows ARP requests being generated, but no replies.

When changing the configuration so each port belongs to a different subnet (let's say port 1 of both NICs belongs to 192.168.100.0/24 and port 2 of both NICs belongs to 192.168.101.0/24) and I ping again, it works.

Searching over Google, I found the next link. According to this, the problem may be that, "in Linux, the IP address is belongs the host and is not associated with the interface". So I guess that when host B receives a ping, and tries to reply, it doesn't know through which interface it has to be sent back.

Nonetheless, I have not fully understood what this statement actually means. Could anyone help me understand it and why ARP requests aren't replied either (I thought MAC addresses were associated with interfaces)?

anmomu92
  • 189

1 Answers1

3

The wording "in Linux, the IP address belongs to the host and is not associated with the interface" is not fully correct. Actually, in Linux IP address is associated with the interface, but kernel's TCP/IP stack responds to any known IP address on any interface. So if you have for example two interfaces, 10.0.0.1 connected to network 10.0.0.0/16, and 192.168.0.1 connected to network 192.168.0.0/16, then if you ping 10.0.0.1 from any device on the network 192.168.0.0/16 (of course assuming that routing is set so that it directs these packets to 192.168.0.1), you will get a reply from the interface 192.168.0.1 claiming to be from 10.0.0.1, even if the IP forwarding is not turned on in the kernel.

Therefore, if two interfaces are connected to the same subnet, you can never know which one will respond. The same applies for ARP requests, as ARP requests are send by broadcast to all interfaces in the subnet asking "who has IP address a.b.c.d?". Either interface will recognize this address as it's own and either may respond.

raj
  • 11,409