Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Aug 2003 08:13:24 -0400 (EDT)
From:      Mitch Collinsworth <mitch@ccmr.cornell.edu>
To:        Nick Barnes <Nick.Barnes@pobox.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Translate MAC address to IP address
Message-ID:  <Pine.LNX.4.51.0308130808520.20273@saruman.ccmr.cornell.edu>
In-Reply-To: <65626.1060774393@thrush.ravenbrook.com>
References:  <65626.1060774393@thrush.ravenbrook.com>

next in thread | previous in thread | raw e-mail | index | archive | help

If you ping the broadcast addr you will (should) get a reply from
all hosts.  This will give you a full arp table that can be
grep'd programatically.  The only hitch is that it's possible for
someone to put a firewall or other custom setup on a machine to
prevent it from replying to ping.

Another way would be to decode packets to read the IP from address.
Not sure if tcpdump has that ability or it it would take some
coding.  I've always done it with arp myself.

-Mitch


On Wed, 13 Aug 2003, Nick Barnes wrote:

> [-net seems to be the right forum for this.]
>
> I have some MAC addresses from a local Ethernet segment.  I want to
> convert them into IP addresses.  How can I do that programmatically?
> (i.e. not "ping likely candidates and then eyeball the arp -a
> output").  I'm prepared to burn hundreds of packets, and possibly wait
> a few seconds, to get the result.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.51.0308130808520.20273>