mariusv.com

Watch as I awkwardly stumble through life

Ping entire subnet

Posted by Marius Voila on March 31, 2010 in London, U.K . — 0 comments This post contains 67 words

Wrote a quick bash script to find which ip’s on our subnet return a ping.

#!/bin/bash
for ((i=1;i<=255;i+=1)); do
echo "Pinging 192.168.1.$i"
ping -c 5 -W 20 192.168.1.$i >> ping_log.txt
done

Or I just could’ve used nmap:

**nmap -sP 192.168.1.0/24**

[