A network is defined using this information and all available IP addresses in that network is obtained as a list. The ipaddress module is used to define the network and to get the IP addresses that are available on that network.Īt first, the program asks the user to input a network address using the CIDR notation (network address/prefix) format. The subprocess module lets you spawn new processes on which you run the ping command. You need two Python modules - subprocess and ipaddress. To run this on Linux/Unix platforms just change the parameters for the ping command. ![]() This script has been tested on Python version 3.4.3 on Windows platforms. On a network that uses DHCP, this script can be used to find out which IP addresses are used and which all are available. This is a simple and very useful Python script for network administrators to monitor the devices on a network by pinging every IP address on a subnet.
0 Comments
Leave a Reply. |