Tuesday, October 25, 2022

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

Issue

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?


Solution

You should use NMAP:

nmap -T5 -sP 192.168.0.0-255


Answered By - Roman Newaza
Answer Checked By - Senaida (WPSolving Volunteer)