0

Suppose I have these 3 IP Prefixes :

190.154.27.0/26 190.154.27.64/26 190.154.27.192/26

and I want find the aggregate prefix.

I convert each address to its' binary equivalent:

10111110.10011010.00011011.00000000
10111110.10011010.00011011.01000000
10111110.10011010.00011011.11000000

And we see that the common pattern lasts until the end of the third octet (24 digits). So shouldn't the aggregate be 190.154.27.0/24 ? Why is it 190.154.26.0/23 ?

NickDelta
  • 103
  • 2

1 Answers1

0

Looking at the prefixes without their length is not sufficient. You need to make sure that you don't inadvertently aggregate subnets in between.

One method would be to decrease a prefix length by one bit and check if the resulting prefix encompasses more/all other subnets.

In your example,

A. 190.154.27.0/26 (190.154.27.0 - 190.154.27.63)
B. 190.154.27.64/26 (190.154.27.64 - 190.154.27.127)
C. 190.154.27.192/26 (190.154.27.192 - 192.154.27.255)

A and B can be cleanly aggregated to 190.154.27.0/25. Note that 190.154.27.0/24 also includes an additional subnet, 190.154.27.128/26 which may or may not be a problem.

190.154.26.0/23 also includes the entire 190.154.26.0/24 subnet. You're not giving a clue to why that should be required.

Zac67
  • 90,111
  • 4
  • 75
  • 141