To obtain a list of all valid IP addresses in the local network, several methods can be employed, depending on the operating system. The following are some commonly used methods on Windows and Linux operating systems:
Windows System
-
Using Command-Line Tools
In Windows, the
arp -acommand can be used. This command displays the ARP table of the current device, which includes all known IP addresses and their corresponding MAC addresses on the local network. Open the Command Prompt and enter the following command:basharp -aThis will list all IP addresses and MAC addresses of devices on the local network.
-
Using Third-Party Tools
Tools like Advanced IP Scanner can be used to discover and list all devices on the network. These tools typically provide a user-friendly interface and additional network management features, such as remote control and resource management.
Linux System
-
Using
nmapToolnmapis a powerful network scanning and security auditing tool. To scan all valid IP addresses in the local network, use the following command:bashnmap -sn 192.168.1.0/24where
192.168.1.0/24is the subnet of your local network. This command scans every IP address in this subnet to identify which are active. -
Using
arp-scanToolarp-scanis a tool used to send ARP packets to discover active IP addresses on the network. After installingarp-scan, you can run the following command to scan the local network:bashsudo arp-scan --localnetThis command scans the local subnet and lists all IP addresses and MAC addresses of devices that respond to ARP queries.
Common Methods
-
Checking the DHCP Server
If you can access the DHCP server on the network (typically a router or dedicated server), you can check the DHCP lease table, which lists all currently assigned IP addresses and their corresponding devices.
By using the above methods, you can effectively obtain all valid IP addresses in the local network on both Windows and Linux systems. These methods are very useful for daily network management and troubleshooting.