LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Get IP to MAC address translation (https://www.linuxquestions.org/questions/linux-networking-3/get-ip-to-mac-address-translation-540664/)

bhupeshchawda 03-26-2007 05:05 AM

Get IP to MAC address translation
 
Hi all, I need to get the MAC address of a machine on my LAN. I want to get the MAC address with the IP address as an input.
Can any one help me get the code for that or atleast some links for the resources...
Thanx in advance...

-Bhupesh

Nick_Battle 03-26-2007 05:42 AM

Sounds like you want to access the ARP protocol tables. See http://linux-ip.net/html/tools-arp.html.

HTH,
-nick

dariokk 05-15-2009 01:21 PM

Solution: Obtain MAC Address from IP Address
 
You have two ways to do this.

In a terminal, with root user:

nmap -v IP_ADDRESS -p 0 |grep MAC |cut -c 14-30

You need to be in the same network.

The other way:

ping IP_ADDRESS

arp -a |grep IP_ADDRESS |awk '{ print $4 }'


All times are GMT -5. The time now is 09:29 AM.