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
  • 84,333
  • 4
  • 69
  • 133
  • I'm reading the book TCP/IP Illustrated and it has a very incomprehensible example. So if the addition of the 190.154.27.128/26 subnet isn't a problem then for those 3 subnets the correct aggregate is 190.154.27.0/24 right ? – NickDelta Oct 06 '19 at 10:23
  • Yes. I've broken down the subnets into start/end addresses above. I hope it makes it easier to comprehend. – Zac67 Oct 06 '19 at 11:04
  • I've just pulled the book and that's pretty much what it says in there, too. – Zac67 Oct 06 '19 at 11:16
  • I just couldn't understand why the 190.154.26.0/24 should be added. You made me get that this subnet is an extra. Thank you very much. – NickDelta Oct 06 '19 at 11:35