Ping as an IP scanner allows to find reachable ip addresses in a subnet or for a network range
How to find ip addresses and discover devices on the network using ping. Depending on the purpose and task, free IP-scanner tools can be found in plentiful quantity on the Internet. Sometimes there is no tool available because you are at the user’s workplace. Where the guidelines prohibit the installation of non-approved tools the possibility to scan the network segment with Windows built-in tools.
Find IP address in network range using ping
This is where the execution of ping in a for-loop help us. This example send ping to all IPv4 addresses of a subnet from the command prompt. Run in a one-liner to find the IP addresses that are currently online.
for /l %i in (1,1,255) do @ping 192.168.57.%i -w 1 -n 1 | find /i "ttl="
The for loop with counter 1 starts at 1 and ends at 255, which pings a Class C network with 255 hosts (CIDR /24). Class C are the most commonly used network segments, for example, if the netmask 255.255.255.128 (25) is used, the last octet figure 128 is taken.
-w 1 represents a timeout of 1 millisecond for each response.
-n 1 is the number of echo requests to send.
find /i "ttl=" only the ICMP responses will be output.
C:\> for /l %i in (1,1,255) do @ping 192.168.57.%i -w 1 -n 1 | find /i "ttl=" Reply from 192.168.57.1: Bytes=32 Time=2ms TTL=255 Reply from 192.168.57.10: Bytes=32 Time=301ms TTL=64 Reply from 192.168.57.70: Bytes=32 Time=295ms TTL=64 Reply from 192.168.57.80: Bytes=32 Time<1ms TTL=128 Reply from 192.168.57.112: Bytes=32 Time=1ms TTL=255
This Tutorial show how to use the icmp utility to detect reachable devices in a subnet or a netwerk range. It should prove that it is also possible without network tools. Where no tools can be taken, it can be used as a proven procedure.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?