Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Mar 2005 10:39:51 +0700 (ICT)
From:      Olivier Nicole <on@cs.ait.ac.th>
To:        freebsd-net@freebsd.org
Subject:   Resolving MAC address
Message-ID:  <200503240339.j2O3dpoN099306@banyan.cs.ait.ac.th>

next in thread | raw e-mail | index | archive | help
Hi,

Is there a command, or a short C code that I could use to resolve the
MAC address for a given IP address?


# ping -c 1 10.0.0.1
PING 10.0.0.1 (10.0.0.1): 56 data bytes
64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=0.974 ms

--- 10.0.0.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.974/0.974/0.974/0.000 ms
# arp 10.0.0.1
? (10.0.0.1) at 00:e0:29:ad:5a:aa on em0 [ethernet]

will do the trick, but it is a bit too heavy for the purpose, I'd
prefer a solution that only send an ARP request.

Best regards,

olivier



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