Ping all addresses in network, windows

前端 未结 11 1506
庸人自扰
庸人自扰 2021-01-30 00:14

Is it possible in windows cmd line to check all of the network addresses (with ping or similar) to see which ones are taken/ have active devices:

ie. something that does

相关标签:
11条回答
  • 2021-01-30 00:45

    An expansion and useful addition to egmackenzie's "arp -a" solution for Windows -

    Windows Example searching for my iPhone on the WiFi network

    (pre: iPhone WiFi disabled)

    • Open Command Prompt in Admin mode (R.C. Start & look in menu)
    • arp -d <- clear the arp listing!
    • ping 10.1.10.255 <- take your subnet, and ping '255', everyone
    • arp -a
    • iPhone WiFi on
    • ping 10.1.10.255
    • arp -a

    See below for example:

    Here is a nice writeup on the use of 'arp -d' here if interested -

    • TechRepublic - Quick Tips Flush the ARP cache in Windows 7
    0 讨论(0)
  • 2021-01-30 00:47

    Provided the windows box is in the same subnet:

    for /L %a in (1,1,254) do start ping 192.168.0.%a
    

    This will complete in less than 15 seconds and

    arp -a 
    

    will return any alive host.

    Fastest native way I know of in Windows.

    0 讨论(0)
  • 2021-01-30 00:54

    I know this is a late response, but a neat way of doing this is to ping the broadcast address which populates your local arp cache.

    This can then be shown by running arp -a which will list all the addresses in you local arp table.

    ping 192.168.1.255
    arp -a
    

    Hopefully this is a nice neat option that people can use.

    0 讨论(0)
  • 2021-01-30 00:54

    Best Utility in terms of speed is Nmap.

    write @ cmd prompt:

    Nmap -sn -oG ip.txt 192.168.1.1-255

    this will just ping all the ip addresses in the range given and store it in simple text file

    It takes just 2 secs to scan 255 hosts using Nmap.

    0 讨论(0)
  • 2021-01-30 00:54
    for /l %%a in (254, -1, 1) do ( 
        for /l %%b in (1, 1, 254) do (
            for %%c in (20, 168) do (
                for %%e in (172, 192) do (
                    ping /n 1 %%e.%%c.%%b.%%a>>ping.txt
                )
            )
        )
    )
    pause>nul
    
    0 讨论(0)
提交回复
热议问题