Discovery Subnet with Ping

Sometime we need to discover an entire subnet.

This is a small script not so fast but easy:

#!/bin/sh
subnet=10.10.10.
addr=1
while [ $addr -lt 256 ]; do
ping -c 1 -t 1 $subnet$addr > /dev/null && echo $subnet$addr Is Alive
let addr=addr+1
done

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.