Translate MAC address to IP address

Nick Barnes Nick.Barnes at pobox.com
Fri Aug 15 07:54:09 PDT 2003


At 2003-08-15 14:15:00+0000, Lars Eggert writes:
> Nick Barnes wrote:
> > Thanks for the reference.  I had a look at arping. It works by sending
> > a broadcast ping to the specified MAC address (not to the broadcast
> > MAC).  I note that FreeBSD machines do respond to such pings (unlike
> > regular broadcast pings), but some machines do not (e.g. WinXPPro,
> > NT4).
> 
> it also supports setting the source IP and MAC address to one specified 
> on the command line. This usually works for these other boxes, if you 
> use a valid one for the net you're on.

The source IP and MAC are not a problem (they are both set correctly
already). The problem is that the ping packets don't have an
appropriate destination IP address.  This can be set with the -T
option for arping, but if I set it to anything other than the target
machine's actual address (which I'm trying to use arping to find!)
then WinXPPro, for instance, will not respond:

# XP Pro 193.112.141.247 00:07:e9:92:c0:76
# default arping, destination address 255.255.255.255:
# NO RESPONSE

# ./arping -c 1 -q -i rl0 00:07:e9:92:c0:76
15:43:02.245550 0:50:fc:1:f4:e 0:7:e9:92:c0:76 0800 60: 193.112.141.249 > 255.255.255.255: icmp: echo request
# 

# Use -T to set destination address to local broadcast 193.112.141.255:
# NO RESPONSE

# ./arping -T 193.112.141.255 -c 1 -q -i rl0 00:07:e9:92:c0:76
15:43:14.577626 0:50:fc:1:f4:e 0:7:e9:92:c0:76 0800 60: 193.112.141.249 > 193.112.141.255: icmp: echo request
# 

# Use -T to set destination address to another local address 193.112.141.248:
# NO RESPONSE

# ./arping -T 193.112.141.248 -c 1 -q -i rl0 00:07:e9:92:c0:76
15:44:45.764904 0:50:fc:1:f4:e 0:7:e9:92:c0:76 0800 60: 193.112.141.249 > 193.112.141.248: icmp: echo request
# 

# Use -T to set destination address to the actual target address
# (which we are trying to use arping to find):
# RESPONSE (i.e. the machine is working).

# ./arping -T 193.112.141.247 -c 1 -q -i rl0 00:07:e9:92:c0:76
15:48:47.687538 0:50:fc:1:f4:e 0:7:e9:92:c0:76 0800 60: 193.112.141.249 > 193.112.141.247: icmp: echo request
15:48:47.687680 0:7:e9:92:c0:76 ff:ff:ff:ff:ff:ff 0806 60: arp who-has 193.112.141.249 tell 193.112.141.247
15:48:47.687710 0:50:fc:1:f4:e 0:7:e9:92:c0:76 0806 60: arp reply 193.112.141.249 is-at 0:50:fc:1:f4:e
15:48:47.687775 0:7:e9:92:c0:76 0:50:fc:1:f4:e 0800 60: 193.112.141.247 > 193.112.141.249: icmp: echo reply
#

Nick B


More information about the freebsd-net mailing list