Skip to main content

Ping group on Windows with FOR command

Source: https://www.foodbev.com/news/food-and-drink-firms-join-loop-waste-free-shopping-platform/

Notes from daily work situation.

One of my colleagues asked me to find out which IP address that his home router dynamically assign to his brand new TOTOLINK N9 Ceiling Mount Access Point without accessing to the home router.

Look at TCP/IP settings, I know the IP address range that the home router assign to client is 192.168.1.2 - 192.168.1.254.


I also know MAC address of the new TOTOLINK N9 Access Point.

So, the idea is using his laptop to ping IP addresses from 192.168.1.2 - 192.168.1.254, then using arp -a command to find out MAC Address of TOTOLINK N9 Access Point.

So, I use FOR command to ping a group of IP Addresses from 192.168.1.1 to 192.168.1.254

FOR /L %variable IN (start,step,end) DO command [command-parameters]

    The set is a sequence of numbers from start to end, by step amount.
    So (1,1,5) would generate the sequence 1 2 3 4 5 and (5,-1,1) would generate the sequence (5 4 3 2 1)


for /l %i in (1,1,254) do @ping 192.168.1.%i -n 1 -w 100 | find "Reply"

-n count       Number of echo requests to send
-w timeout     Timeout in milliseconds to wait for each reply


Ping and Arp command to find IP Address and MAC of TOTOLINK N9
Ping and Arp command to find IP Address and MAC of TOTOLINK N9

Popular posts from this blog

Wireguard VPN: Notes

Notes while trying Wireguard VPN on some of my testbeds.

Docker for Windows: Access Denied

Today, I get this error when running Docker for Windows on Windows 10 Build 1803. So, I check my current username (run whoami ) and add that user to docker-users local group, which has only NT AUTHORITY\SYSTEM account in members list. I must log out and log in again to run Docker for Windows.

Windows Command: arp - Address Resolution Protocol

Notes from daily work situation. While troubleshooting HSRP, I need to delete arp table on my computer. arp -d * Take a look at other options with arp command: C:\Users\Administrator>arp /? Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol (ARP). ARP -s inet_addr eth_addr [if_addr] ARP -d inet_addr [if_addr] ARP -a [inet_addr] [-N if_addr] [-v] -a Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed. -g Same as -a. -v Displays current ARP entries in verbose mode. All invalid entries and entries on the loop-back interface will be shown. inet_addr Specifies an internet address. -N if_a...