System information
It's easiest to start at one end or other of the netblock and start carving out the biggest chunks first. So
our first two blocks will be the two /27 netblocks. The first is too easy:
192.168.1.0/27. == 192.168.1.0-192.168.1.31.
Then we have:
192.168.1.32/27 == 192.168.1.32-192.168.1.63.
Remember, the .0 and .32 addresses are the network addresses; the .31 and .63 are the broadcast
addresses. It's best to pick a policy for how to set your gateways. This can be either the first or last
usable address in a subnet. I like to use the first, so the gateways will be 192.168.1.1 and 192.168.1.33.
The rest are open for clients. We can continue to carve up our network, subnetting to suit our needs.
Adjacent and Contiguous
When we received our netblock, it was one contiguous block. That is, it went from the first to last IP
with no subnetting. All the IPs were on the same subnet. After carving them up, we had IPs, some of
which were now in adjacent subnets.
Looking at our network and the changing demands, we now see we need to open up a particular subnet
and combine two adjacent networks into one contiguous block again. But can we do this? The answer
is a qualified, yes.
The question is not whether we can combine two adjacent blocks into one contiguous block or not, the
question is how much we have to open up the netmask to accomplish this.
So let's take two examples. The first one is easy. We have two netblocks:
192.168.1.112/29
192.168.1.120/29
The suffix tells us we have 3 binary places (32 – 29 = 3), which is the same as 2^3 (2 raised to the 3d
power – i.e., 2 cubed) or 8.
Now the network address we want to eliminate is 120. If you divide 120 by 8 you get 15. Because 15 is
an odd number, we can combine these two subnets into one /28. Checking our math, 2^4 power is 16.
If we divide 120 by 16, we get 7 with a remainder of 8. And 16 times 7 equals 112. This confirms that
112 will be our network address, and that 120 cannot be. So we can combine 192.168.1.112/29 and
192.168.1.120/29 into 192.168.1.112/28.
Before we go any farther, let's make sure we understand the rules for combining adjacent networks:
1. The adjacent networks must be the same size. You cannot combine two adjacent networks of
unequal size.
2. If the upper network's network IP is divisible by the current number of IPs and the division
results in an odd number, or if divided by the twice the current number of IPs and results in a
number with a remainder, then you can combine the networks. Otherwise, you can't.
The next example will show the above rules more clearly. We have two networks:
192.168.1.48/28
192.168.1.64/28