Fastest way to ping a network range and return responsive hosts?

user1552586 picture user1552586 · Dec 26, 2012 · Viewed 123.3k times · Source

Constraints:
1. Speed matters.
2. I am allowed to ping once.

I'm debating whether to use Python or shellscripting. Is there a method faster than bash?

Here is the current code,

for ip in $(seq int1 int2); do
    ping -c 1 xxx.xxx.xxx.$ip | grep "bytes from" &
done

Anything faster than this?

Answer

Roman Newaza picture Roman Newaza · Dec 26, 2012

You should use NMAP:

nmap -T5 -sP 192.168.0.0-255