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


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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.