You might have better luck using the tool arping
instead. The tool ping
works at the layer 3 level of the OSI model, whereas arping
works at layer 2.
You still need to know the IP of the system however with this tool. There are 2 versions of it, the standard one included with most Unixes (Alexey Kuznetsov's) is the version that can only deal with IP addresses. The other version (Thomas Habets') supposedly can query using MAC addresses.
$ sudo arping 192.168.1.1 -c 1
ARPING 192.168.1.1 from 192.168.1.218 eth0
Unicast reply from 192.168.1.1 [00:90:7F:85:BE:9A] 1.216ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)
arping
works similarly to ping
except instead of sending ICMP packets, it sends ARP packets.
Getting a system's IP using just the MAC
Here are a couple of methods for doing the reverse lookup of MAC to IP.
nmap
$ nmap -sP 192.168.1.0/24
Then look in your arp cache for the corresponding machine arp -an
.
fping
$ fping -a -g 192.168.1.0/24 -c 1
Then look in your arp cache, same as above.
ping
$ ping -b -c1 192.168.1.255
Then look in your arp cache, same as above.
nbtscan (windows only hosts)
$ nbtscan 192.168.1.0/24
Doing NBT name scan for addresses from 192.168.1.0/24
IP address NetBIOS Name Server User MAC address
------------------------------------------------------------------------------
192.168.1.0 Sendto failed: Permission denied
192.168.1.4 MACH1 <server> <unknown> 00-0b-12-60-21-dd
192.168.1.5 MACH2 <server> <unknown> 00-1b-a0-3d-e7-be
192.168.1.6 MACH3 <server> <unknown> 00-21-9b-12-b6-a7