Assume that a company has five departments. Department A has 10 hosts, department B has 15 hosts, Department C has 30 hosts, and department d has 20 hosts.
The CIO assigned a total CIDR Block: 192.168.2.0/24. How to divide separate CIDR blocks for each department.
According to the root question, the number of subnets is <= 4, the number of hosts is <= 30, and the network segment is Class C --> default subnet mask: 255.255.255.0 to the binary number: 11111111.111111.111111.00000000
Subnet division converts the number of subnets at the expense of the number of hosts. The Npower of 2 is less than or equal to 4, and N is equal to 2. You need to sacrifice two host bits and the corresponding binary code 11111111.111111.111111.111111.11000000 to decimal: Invalid bandwidth limit 192, so the subnet mask is invalid bandwidth limit 192.
To verify that the subnet structure meets the requirements, calculate that the current subnet host should be 2 to the power of 6 minus 2 equals 62> = 30
Therefore, we can sort and combine the calculated subnet masks to obtain four subnets:
11111111.111111.1111111111.00000000
11111111.111111.1111111111.0000000
11111111.111111.1111111111.0000000
11111111.111111.1111111111.1120.00
At the same time, in the Network Address Allocation, addresses with the same 1 and 0 do not need to be used. Therefore, after conversion to decimal, there are only two subnets.
So what should we do if the subnet is not enough? We used to divide the subnet based on the number of subnets. So what should we do next?
Use the Npower of formula 2 to subtract 2> = the maximum number of hosts, according to the previous n = 5.
Therefore, the host bit is five bits, and the corresponding subnet number is three bits. The subnet mask is 11111111.111111.111111111111.111111.111111.11100000.
Sort and combine the calculated subnet masks to obtain the number of eight sub-networks:
11111111.111111.1111111111.00000000
11111111.111111.1111111111.00100000
11111111.111111.1111111111.0000000
11111111.111111.1111111111.01100000
11111111.111111.1111111111.0000000
11111111.111111.1111111111.10100000
11111111.111111.1111111111.1120.00
11111111.111111.1111111111.11100000
In the network address allocation, the addresses with the same 1 and 0 are not used. Therefore, after conversion to decimal, there are only six subnets.
And
Too many 32
Optional bytes 64
Limit limit 96
2017100000000128
2017100000000160
Maximum capacity limit 192
Convert the IP address of ip192.168.2.0 to the binary address (11111111.111111.00000010) and the subnet mask.
(1) 255.255.255.255.32: 192.168.2.33 ~ 192.168.2.62 --> subnet 192.168.2.32
(2) 255.255.255.255.64: 192.168.2.65 ~ 192.168.2.94 --> subnet 192.168.2.64
(3) zookeeper 96: 192.168.2.97 ~ 192.168.2.126 --> subnet 192.168.2.98
(4) 255.255.255.128: 192.168.2.129 ~ 192.168.2.158 --> subnet 192.168.2.128
(5) 255.255.255.255.160: 192.168.20.1 ~ 192.168.2.190 --> subnet 192.168.2.160
(6) 255.255.255.192: 192.168.2.193 ~ 192.168.2.222 --> subnet 192.168.2.192
The subnet mask is too many
IP subnet Instance Division