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.