[421] in linux-net channel archive
Re: ARP: multiple entries (possible bug)
daemon@ATHENA.MIT.EDU (Michael Callahan)
Mon Jun 5 22:32:39 1995
Date: Tue, 6 Jun 1995 02:07:56 +0100 (BST)
From: Michael Callahan <callahan@maths.ox.ac.uk>
To: Herbert Rosmanith <herp@wildsau.idv.uni-linz.ac.at>
cc: linux-net@vger.rutgers.edu
In-Reply-To: <199506052029.WAA03479@wildsau.idv.uni-linz.ac.at>
On Mon, 5 Jun 1995, Herbert Rosmanith wrote:
> is it allowed that for one IP-address more than one MAC-address is
> stored in the arp table ?
Yes. See below.
> >> # arp -a
> >> Address HW type HW address Flags Mask
> >> 140.78.40.62 10Mbps Ethernet 00:C0:6C:41:42:31 C *
> >> 140.78.40.31 10Mbps Ethernet 00:00:0C:08:28:37 C *
> >> # ifhwaddr eth0
> >> 40:52:43:d0:0d:38
> >> # arp -s 140.78.40.62 `ifhwaddr eth0` 255.255.255.252 pub
> >> # arp -a
> >> Address HW type HW address Flags Mask
> >> 140.78.40.31 10Mbps Ethernet 00:00:0C:08:28:37 C *
> >> 140.78.40.62 10Mbps Ethernet 40:52:43:D0:0D:38 CMP *
> >> # ping -c 1 140.78.40.62
> >> PING 140.78.40.62 (140.78.40.62): 56 data bytes
> >> 64 bytes from 140.78.40.62: icmp_seq=0 ttl=255 time=2.5 ms
> >>
> >> --- 140.78.40.62 ping statistics ---
> >> 1 packets transmitted, 1 packets received, 0% packet loss
> >> round-trip min/avg/max = 2.5/2.5/2.5 ms
> >> # arp -a
> >> Address HW type HW address Flags Mask
> >> 140.78.40.62 10Mbps Ethernet 00:C0:6C:41:42:31 C *
> >> 140.78.40.31 10Mbps Ethernet 00:00:0C:08:28:37 C *
> >> 140.78.40.62 10Mbps Ethernet 40:52:43:D0:0D:38 CMP *
The arp -a doesn't really show you what's going on, unfortunately.
Every arp table entry is associated with a single device. This
association has very different significance for a published and a regular
arp entry.
First a regular one: the regular entry above for 140.78.40.62 is
associated with eth0, meaning that when the networking code wants to send
a packet to that IP address on that device (as determined by routing) it
will use the given hardware address 0:c0:6c..etc.
Now the published entry. This entry is also associated with eth0...
however, it means that the Linux box will do proxy-arp for that IP address
on every interface EXCEPT eth0. That's because it wouldn't make sense to
be doing proxy arp for an address on the interface where we ourselves
would send outgoing packets for that address. (Think about it.)
The way it works now is, in fact, useful. You can use proxy arp entries
to do a hacked-up form of manual bridging between two ethernets. This
obviously requires two arp entries to be held for a given address, one
for the real hardware address and another for the proxy.
By the way, if what you're trying to do is have a single machine respond
to multiple IP addresses, you should investigate the ipalias patches much
discussed here recently.
Michael