Monday, March 28, 2011

fping -- A nice addition to the networking toolbox

0 comments
I work in a networking environment and so I've been looking for tools to do quick jobs without having to go out and get an SNMP setup going. One of the tasks I have is occasionally tracking down a device or router by it's MAC address.

The great network utility nmap will do it but for a quick job I found fping http://fping.sourceforge.net/.

In order to find out the IP of an errant router by its MAC address you use arp -a or arp -n to look in your ARP cache. In order to get it in there you can write a script to ping every host in a subnet or you can use fping.

$ fping -c 1 192.168.0.0/24

This will rapidly ping the subnet filling the arp cache with the IP to MAC address mappings.

Then you can use (depending on your arp implementation, mine is a Debian variant)

$ arp -n

To print out a list of IP's and MAC addresses.

You may have to use

$ arp -a

To make things go a little faster if you have a big list you can grep for the last few digits of the MAC

arp -n (or a) |grep -i 863b2

You'll get your IP and you won't have to go sniffing with the very capable but complex tool wireshark or some similar.

All the best!