0

I am working with a vpc cidr of /23, and need to divvy up some public and private subnets for hosts, load balancers availability zones etc. please bear with this newbie question Please assume I am talking about the last portion of the IP where needed

If I wanted a block of 16 and a block of 32 how would I do it? A 0/28 would get me a block of 16.. and this will imply further blocks of 16/28, 32/28 etc, unless I have the wrong notion If I wanted a block of 32 in addition to this, would it be correct to specify 0/27 ? Or would this collide with 0/28? What is the right way?

gk_2000
  • 1
  • 1

1 Answers1

1

Yes, they overlap, if you’re using the same third octet. If you aren’t, they won’t.

If, for example, your /23 is 10.0.0.0/23, it gives you 10.0.0.0-10.0.1.255.

For example, if you use a different third octet:

10.0.0.128/25 gives you 10.0.0.128-10.0.0.255
10.0.1.192/26 gives you 10.0.1.192-10.0.1.255

So, there is no overlap.

But, for example, if you use the same third octet:

10.0.1.128/25 gives you 10.0.1.128-10.0.1.255.
10.0.1.192/26 gives you 10.0.1.192-10.0.1.255

So, half of the /25 overlaps with the /26.

For the record, AWS won’t allow you to enter them like that because of the overlap - they will force you to change one or both of them.

As for your other question of /27 and /28, you need to account for the network and broadcast addresses taking up 2 of your addresses in each of those. So, while /27 does have 32 addresses, only 30 are usable for hosts. The same would go for /28 (16 total with 14 usable host addresses). So, you need 16 and 32 usable addresses, you would have to use a /27 and /26, respectively, since those are the mask sizes that can accommodate those host counts with minimal waste.

Let’s again say your /23 is 10.0.0.0/23:

If you want to break it up into /27 and /28 blocks and use the same third octet, you could use:

10.0.1.0/27 for one block
10.0.1.32/28 for the other block

If you want to break it up into /26 and /27 blocks and use the same third octet, you could use:

10.0.1.0/26 for one block
10.0.1.64/27 for the other block

If you want to break it up into /27 and /28 blocks and use a different third octet, you could use:

10.0.0.0/27 for one block
10.0.1.32/28 for the other block

If you want to break it up into /26 and /27 blocks and use a different third octet, you could use:

10.0.0.0/26 for one block
10.0.1.64/27 for the other block

There are more combinations you could potentially use - these are just examples.

Jesse P.
  • 4,690
  • 1
  • 10
  • 14