Is there a command line based way to send pings to each computer in a subnet? Like
for(int i = 1; i < 254; i++)
ping(192.168.1.i);
t
I just came around this question, but the answers did not satisfy me. So i rolled my own:
echo $(seq 254) | xargs -P255 -I% -d" " ping -W 1 -c 1 192.168.0.% | grep -E "[0-1].*?:"
-W 1
"). So it will finish in 1s :)64 bytes from 192.168.0.16: icmp_seq=1 ttl=64 time=0.019 ms 64 bytes from 192.168.0.12: icmp_seq=1 ttl=64 time=1.78 ms 64 bytes from 192.168.0.21: icmp_seq=1 ttl=64 time=2.43 ms 64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=1.97 ms 64 bytes from 192.168.0.11: icmp_seq=1 ttl=64 time=619 ms
Edit: And here is the same as script, for when your xargs do not have the -P flag, as is the case in openwrt (i just found out)
for i in $(seq 255);
do
ping -W 1 -c 1 10.0.0.$i | grep 'from' &
done