Resolving MAC address

Olivier Nicole on at cs.ait.ac.th
Wed Mar 23 19:37:34 PST 2005


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


More information about the freebsd-net mailing list