How to calculate an IP address that is not assigned

Source: Internet
Author: User
Now there is a section of Class B IP address 119.115.0.0--119.115.255.255, now I assign departments to use, but still left those addresses are not assigned out, through manual calculation is very complicated, because some address is very small, very messy, not well managed, So calculate it by MySQL. Also use MySQL's function Inet_aton (' 119.115.0.0 ') to derive an integer. In addition MySQL database field set four fields, starting IP, terminating IP, starting IP integer, terminating IP integer, How to calculate an IP address that is not assigned. Can MySQL be alone or mysql+php? Thank you very much please enlighten me.

119.115.0.0--119.115.255.255 Assign the following address

119.115.136.132,119.115.136.135

119.115.141.0,119.115.141.15

119.115.136.88,119.115.136.91

Reply content:

Now there is a section of Class B IP address 119.115.0.0--119.115.255.255, now I assign departments to use, but still left those addresses are not assigned out, through manual calculation is very complicated, because some address is very small, very messy, not well managed, So calculate it by MySQL. Also use MySQL's function Inet_aton (' 119.115.0.0 ') to derive an integer. In addition MySQL database field set four fields, starting IP, terminating IP, starting IP integer, terminating IP integer, How to calculate an IP address that is not assigned. Can MySQL be alone or mysql+php? Thank you very much please enlighten me.

119.115.0.0--119.115.255.255 Assign the following address

119.115.136.132,119.115.136.135

119.115.141.0,119.115.141.15

119.115.136.88,119.115.136.91

First, the network segment, you give a section of the IP range what is the use of?
The network segment is determined by the ip+ mask
119.115.0.0--119.115.255.255 Assign the following address

119.115.136.132,119.115.136.135//119.115.136.132-135

119.115.141.0,119.115.141.15//119.115.141.15.0-15

119.115.136.88,119.115.136.91//119.115.136.88-91, this is the public address, right?

The first address segment: 132-135 132 is the network number 135 is the broadcast number can not be used, you can only use 133 134 of these 2 IP with

Second address segment: Ditto you can only use 16-2 = 14 IP Third address segment: Ditto you can only have 2 address segments

Still have questions, ask me again, this is the knowledge that divides the subnet.

This kind of thing to write a small program is not done?

Sort by the first address and then list the gaps in the middle.

  • 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.