IP address segmentation method

Source: Internet
Author: User
Tags ip number
Currently, if the IP address range is not segmented, there are a total of 254 IP addresses.
The algorithm is as follows:
IP: 192.168.1.0
Subnet Mask: 255.255.255.0
The Zookeeper format is 192.168.1.0/24.

Note: "24" indicates 255.255.0 (because the subnetmask is changed to a binary system with a total of 32 bits. A 255 percentile is regarded as a binary system with a total of eight bits. When 255.255.255.0 is changed to a binary system (octal. 0), three octal bits are 24 bits, so "/24" is added after 192.168.1.0 ")

At present, we need to divide 192.168.1.0 into two network segments, that is, each of which has 128 computers. How to score?
Do I divide the 24 into half? Of course not.
To divide 192.168.1.0 into half, the number of IP addresses in the CIDR block is reduced. We should divide the last eight digits of the subnetmask into half, half of which is 254, that is, 128.
Therefore, we should consider the following:
IP: 192.168.1.0
Sub-network mask: 255.255.255.128
255.255.255.192.168.1.254/25

How can I calculate the number of IP addresses?

The sub-website mask contains 32 bits. It currently occupies 25 digits. 32-25 = 7. That is, the 7th Power of 2 = 128. A total of 128 IP addresses.
For example, Zookeeper 255.128. How can this problem be solved?
Divide the maximum IP number (254) of the CIDR block by the number (128) after the subnetmask () = 2, which indicates that the CIDR block is divided into two CIDR blocks, divide the maximum number of IP addresses (254) by 2 = 128, indicating that each segment contains 128 IP addresses.

The following table lists the IP address segment mappings in my hands. To help you understand.

Note:
When the two IP addresses are the same as their subnetmask, the two IP addresses are in the same CIDR block.

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.