Archive for December 28th, 2009

How to find the IP/MAC addresses of devices on your network

December 28, 2009

Every once in a while I need to find out the IP & MAC addresses of various devices in my home network. Here is a small shell script that will find this information. It takes a while to run. Without the initial ping, the arp command will not return the necessary data on an IP address that you’ve never visited from the machine that you’re running this script on.

Perhaps there is a better way of finding the IP/MAC addresses of devices on your network. If so, please let me know.

#!/bin/sh

for (( i = 0; i < 256; i++))
do
    ping -c 1 10.0.1.$i
    arp 10.0.1.$i
done


Follow

Get every new post delivered to your Inbox.