IP address planning is a very important part of network design, in this process can not avoid to deal with some network segments, masks, subnet number, IP type and so on. Python has a third-party module called IPY that can help us do the job.
First, install the IPY module:
1. Use the version method to differentiate IP address types
2. Output the IP number of the network segment and list of all IP addresses by the specified network fault
3. Reverse resolution of IP address, IP type, IP conversion method
4, according to the IP and mask output network segment format
You can also specify different parameter values by using the Strnormal method to customize the network segments of different output types, and the output type is str type.
Value meaning:
0: no return, e.g. 192.168.200.0
1:prefix (prefix) format, such as 192.168.200.0/24
2:decimalnetmask formats, such as 192.168.200.0/255.255.255.0
3:lastip formats, such as 192.168.200.0-192.168.200.255
5, to determine whether the two network segment contains, overlapping and other relations
Example: Returns the corresponding network, mask, broadcast, reverse resolution, subnet number, IP type information based on the IP or subnet entered.
Execution effect:
PYTHON-IPY Module