PYTHON-IPY Module

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.