List the IP Address of all computers connected to a single LAN

后端 未结 5 2237
[愿得一人]
[愿得一人] 2020-12-03 11:57

I am writing a program where you connect, for various reasons, to other computers in a LAN. However, rather than having to input the IP address for multiple computers (a pai

5条回答
  •  臣服心动
    2020-12-03 12:51

    1) Read the subnet mask and calculate all the IP addresses in the subnet mask you are in. Then you can either user ICMP ping (standard ping) or ARP ping to list all the valid IP addresses. ARP Ping is much reliable in a subnet setting.

    2) You can nmap to list all the hosts

    nmap -nsP 192.168.10.1/254 | grep ^Host
    

提交回复
热议问题