Powered by Blogger.

How to Ping All IP Addresses on Your LAN

To monitor the number of existing ad-hoc clients on a wireless LAN, to identify devices that have set their own fixed addresses in the DHCP range or to take inventory of the devices currently connected to your network, you can ping each IP address in the subnet. The list of devices that respond to the ping is a good starting place for accomplishing any of these tasks.


Press the "Windows" key and type "command." Right-click "Command Prompt" and choose "Run As Administrator..." Confirm the request.
Use the DOS "FOR" command to create a loop from one to 254, the range of valid IP addresses on a network. Type: FOR /L %i IN (1, 1, 254)
Follow the FOR loop by the ping command to execute on each iteration. For example, on the same line, type: DO ping -n 1 192.168.1.%i so that the entire line reads: FOR /L %i IN (1,1,254) DO ping -n 1 192.168.1.%i
Press "Enter" to ping the devices on your network. Filter the results to print only the devices that respond to a ping by piping the results into the FIND command. For example, type: FOR /L %i IN (1,1,254) DO ping -n 1 192.168.1.%i | FIND /i "Reply"

Linux or Unix

Sign in to your server and open a command prompt window. Create a single-line shell script that loops through each IP address and pings it.
Use the For statement to create a loop from one to 254. For example, type: for ip in $(seq 1 254);
Add the statement to ping the IP address, substituting the loop variable for the last part of the address, and then end the statement. For example, type: do ping -c 1 192.168.1.$ip; done so that the line reads: for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip; done
Press "Enter" to run the one-liner.


  • Replace "192.168.1" with the subnet for your LAN if it's different.


  • Even a device that's powered on and active at a particular IP address might not answer a ping. Most network devices can be configured either to respond Ping requests or to ignore them.

About the Author

Steve McDonnell's experience running businesses and launching companies complements his technical expertise in information, technology and human resources. He earned a degree in computer science from Dartmouth College, served on the WorldatWork editorial board, blogged for the Spotfire Business Intelligence blog and has published books and book chapters for International Human Resource Information Management and Westlaw.
    Blogger Comment
    Facebook Comment