You have to look up the ARP (Address Resolution Protocol) table for the local network. From a Terminal window you can do arp -a
at the command line and it will print out the ARP table which shows the local network IP addresses and their physical address associations (the MAC addresses). OSX stores the ARP entries in the system routing tables, but I can't find any good references that show how to translate the entries in the system routing table to MAC addresses: I'm betting there is a sysctl
call somewhere, but who knows? There is one unanswered question at Getting routing table on MACOSX (programmatically) that may help, but...
On OSX, the arp
detail is at http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man4/arp.4.html: I'd honestly suggest just doing a system
call and filtering the results for your desired IP address.