PDA

View Full Version : Detecting IP address from Mac Address - Linux



COKEDUDE
June 10th, 2010, 07:36 AM
Can anyone get this to work?

ip neigh flush all > /dev/null; # Clears out your arp cache
fping -c 1 -g -q 192.168.1.0/24 2> /dev/null; # pings all of subnet
arp -n | grep "00:1B:4C:22:28:B1" # Search cache for MAC address
http://programminglinuxblog.blogspot.com/2007/11/detecting-ip-address-from-mac-address.html

Milliways
June 10th, 2010, 08:22 AM
Can anyone get this to work?

ip neigh flush all > /dev/null; # Clears out your arp cache
fping -c 1 -g -q 192.168.1.0/24 2> /dev/null; # pings all of subnet
arp -n | grep "00:1B:4C:22:28:B1" # Search cache for MAC address
http://programminglinuxblog.blogspot.com/2007/11/detecting-ip-address-from-mac-address.html

This is unlikely to work unless you have a NIC with MAC "00:1B:4C:22:28:B1"

Just try "arp -n"

rnerwein
June 10th, 2010, 08:29 AM
hi
i guess you have to use:
arp -n | grep "00:1b:4C:22:28:b1" # lower b not capital or
arp -n | grep -i "00:1B:4C:22:28:B1"

ciao