Hi Gabriel,
Good question, let’s look at these examples. First one:
172.16.10.0/24
172.16.20.0/24
172.16.30.0/24
172.16.40.0/24
172.16.50.0/24
Let’s do it in binary first (in case someone else reads this):
10 = 00001010
20 = 00010100
30 = 00011110
40 = 00101000
50 = 00110010
Only the first 2 bits are the same. Our CIDR notation would be 8 + 8 + 2 = 18 bits and we’ll use network address 172.16.0.0.
This works but it’s slow…you can do it in decimal, just remember the block sizes:
2,4,8,16,32,64,128.
Now you only have to pick a block size that fits all of the networks that you want. The only block size that fits your networks is 64 or 128. We’ll try to be as specific as possible so we’ll go for the 64.
Now you only have to figure out the subnet mask, just use this trick:
256 - block size = subnet mask.
So that’ll be 256 - 64 = 192. The subnet mask will be 255.255.192.0. You can calculate the subnet mask back to the CIDR notation…
255 = 8
255 = 8
192 = 2
So that’s a /18.
So in short, just “pick” a block size that matches all your networks and then figure out the subnet mask and/or CIDR notation.
The other quick method to look at it is like this:
172.16.0.0/24 = 1 network
172.16.0.0/23 = 2 networks
172.16.0.0/22 = 4 networks
172.16.0.0/21 = 8 networks
172.16.0.0/20 = 16 networks
172.16.0.0/19 = 32 networks
172.16.0.0/18 = 64 networks
Now you can see that 172.16.0.0/18 is the summary that will include all those networks that you want…this is the quickest method.
Let’s look at the second example:
192.168.0.0 / 24
192.168.1.0 / 24
192.168.2.0 / 24
192.168.3.0 / 24
192.168.4.0 / 24
Let’s do the “block size” method first. You can choose between 2,4,8,16,32,64 or 128. 2 and 4 are too small so we’ll go for 8.
256 - 8 = 248 so the subnetmask will be 255.255.248.0
255 = 8 bits
255 = 8 bits
248 = 5 bits
So the CIDR notation is /21.
The other quick method to look at this is like this:
192.168.0.0/24 = 1 network
192.168.0.0/23 = 2 networks
192.168.0.0/22 = 4 networks
192.168.0.0/21 = 8 networks.
So we’ll go for 192.168.0.0/21 as our summary. This is the quickest method to find the summary address.
Hope this helps! The only thing to be aware of is that your summaries include networks that you “don’t have”.
Rene