in reply to Re: Re: MAC address for Linux Machine
in thread MAC address for Linux Machine

This may have already been mentioned, but I'll mention it again:

C:\> arp -a <ip-address> (Windows)

or

$ /sbin/arp <ip-address> (Linux)

will give you the MAC address of the specified IP address. You will need to parse the output if you are using this in a script, but the third field (HWaddress) is the one you want to look at.

update: arp will only return valid information about an IP address for other addresses on the same subnet. So, if the IP address you are asking about is beyond a router (or switch), then you will only be able to get information about the nearside router interface. Thanks to yibC for pointing this out.


"Ex Libris un Peut de Tout"