Find pingable IP addresses in a given range

Not all devices on a network will respond to an ICMP requests (meaning they are not pingable) such as a domain controller or a firewall, depending on your network. As for the ones that do respond this simple little command allows you to see which IP responds to your requests.

for /L %z in (1,1,254) do @ping 192.168.2.%z -w 10 -n 1 | find “Reply” 

To customize it to your environment here are the variables.

So here we start out with IP 192.168.2.1 and go through to 192.168.2.254 and here are my results:

Only the active connections reply back. Now lets do this again with the variables changed like so:

for /L %z in (10,1,30) do @ping 192.168.2.%z -w 10 -n 1 | find "Reply"

And my new results are clear.

There is free software that can do this also such as SolarWinds IP Tracker. It does an excellent job doing the same thing. But consider that point, most GUI software is doing the above, it’s just a GUI and this is whats behind the curtains and you didn’t have to install bloatware with it to get the same results.

Leave a Reply

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