Hi,
i noticed some relly strange ARP behavior on my computer. The computer runs
Debian 3.0 with a 2.4.18 kernel.
I installed two networkcards and connected them to a hub. eth0 has
192.168.40.101 and eth1 has 192.168.40.102, both with a subnet mask of
255.255.255.0 and i didn't define a default gateway.
Now i am pinging these two cards from a second computer, that is also
connected to the hub and has a IP-Address of 192.168.40.1 and a netmask of
255.255.255.0.
Now i do the following things:
tron:~# ping 192.168.40.101
PING 192.168.40.101 (192.168.40.101): 56 data bytes
64 bytes from 192.168.40.101: icmp_seq=0 ttl=255 time=0.8 ms
64 bytes from 192.168.40.101: icmp_seq=1 ttl=255 time=0.4 ms
tron:~# arp -a
? (192.168.40.101) at 00:40:05:2D:AB

C [ether] on eth2
then i type:
tron:~# ping 192.168.40.102
PING 192.168.40.102 (192.168.40.102): 56 data bytes
64 bytes from 192.168.40.102: icmp_seq=0 ttl=255 time=0.8 ms
64 bytes from 192.168.40.102: icmp_seq=1 ttl=255 time=0.4 ms
hennes.humungus.lokal (192.168.5.1) at 00:01:02:09:C7:61 [ether] on eth0
? (192.168.40.101) at 00:40:05:2D:AB

C [ether] on eth2
? (192.168.40.102) at 00:40:05:2D:AB

C [ether] on eth2
And that is strange isn't it? Both IP-Addresses in the ARP table have the
MAC-Address of the first (eth0) network card.
Then i did it the other way:
tron:~# ping 192.168.40.102
PING 192.168.40.102 (192.168.40.102): 56 data bytes
64 bytes from 192.168.40.102: icmp_seq=0 ttl=255 time=0.9 ms
64 bytes from 192.168.40.102: icmp_seq=1 ttl=255 time=0.4 ms
tron:~# arp -a
? (192.168.40.102) at 00:40:05:2D:AB

C [ether] on eth2
I stop here because as you see, i get in the ARP-Table the MAC-Address of
the first card, though i pinged the second card.
When you use a default gateway entry, then you will always get the
MAC-Address of the card where the default gateway is set on.
Is this behavior normal? I mean, both cards are in the same segment and get
pinged from a computer that is also in the same segement. Each card should
answer the ping by it's own interface. Very strange. I know that it is not
normal to put two cards on a computer in the same segment + subnet and
normally you would do IP-Aliasing, but why does the Linux Kernel behave this
way? I didn't checked this behavior on Windows-Machines yet, but i will
check it later today.
Any comments welcomed.
Greetz,
Kamran Remin