Check which IP addresses are working in your LAN

Of course pinging a single known IP address is the most simple task in networking but there arises a need when you need to know which devices and systems are available on your network.

For that purpose, the following simple command can do the job for you in Linux:

for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; done

It will start pinging all the addresses from 1 to 254 in the provided network. Change 192.168.1. to whatever you want.

Advertisements

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 )

Google+ photo

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

Connecting to %s