CIDR Block aggregation made easy
Based on my last post on VLSM that did well, today I am going to touch on CIDR Block aggregation.
CIDR - Classless Inter-domain routing, this is the method for allocating IP addresses, showing in the / notation.
Let’s take an example: You mange for different subnets for different departments:
- 192.168.1.0 with /24
- 192.168.2.0 with /24
- 192.168.3.0 with /24
- 192.168.4.0 with /24
Question: What single CIDR block can we summarize all four IP addresses above?
Solution:
Take the starting (smallest IP block) and the ending (largest IP block):
Which in our case are:
192.168.1.0
192.168.4.0
Next up:
We just convert this IP into binary, knowing the power of 2 rule from right to left, when we convert the starting and ending IP Address we get the following:
Starting IP - 192.168.1.0:
192 in binary: 11000000
168: 10101000
1: 00000001
0: 00000000
Ending IP - 192.168.4.0:
192 in binary: 11000000
168: 10101000
4: 00000100
0: 00000000
Now that we have convert both the starting and ending IPs into binary, we see where the bit changed for the network portion (the network portion is the left side of the octet and the host portion is the right side of the octet)
192.168 were same, the bit changed in the 3rd octet, on bit no. 22, so the first 21 bits were identical for both starting and ending IP address.
Therefore the change happened in the 3rd octet, therefore the network portion that remain unchanged are the 1st and 2nd octet.
Answer: 192.168.0.0 with /21 aggregates the above blocks.