Tuesday, April 02, 2013

Getting client MAC Address Remotely on Linux

Tech Blog - This is a simple way of getting client MAC address remotely on a Linux machine provided you know the client IP address, this is very useful specially when setting up fixed addresses on dhcpd.conf, wherein you want to map static IP address to MAC address.

First we install nmap from the yum repository, if your using Cent OS | RHEL | Fedora, in may case I am using Cent OS 6.

yum install nmap.i686

After nmap has been installed, use the command below to find out the mac address mapped to the IP.

# nmap -sP

Starting Nmap 6.25 ( http://nmap.org ) at 2013-04-01 09:50 PHT
Nmap scan report for desktop12 (
Host is up (0.00016s latency).
MAC Address: C8:60:00:D0:69:5F (Asustek Computer)
Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds

If you have no idea what the client IP is you can also use nbtscan if the client are Windows machine to find out any useful information.

# nbtscan -v -s :    Sendto failed: Permission denied      �:00G  �:00U  �:20U      �:1eG      �:1dU __MSBROWSE__ �:01G
*** stack smashing detected ***: nbtscan terminated

If nbtscan is not installed, just do a search on your yum repository and install the package.

No comments:

For suggestion and concerns E-mail