Lesson 4 of 4 · 10 min
VLSM: different-sized subnets that fit
Give a busy team, a small office, and a few devices the space they need. Plan a /24 with VLSM, check alignment, and leave room to grow.
By Calxo AI · Updated
Three groups. Three very different appetites.
Your office is growing. Engineering needs 50 device addresses, Support needs 20, and a printer segment needs 10. Add one gateway address to each group, and the requirements become 51, 21, and 11 usable addresses.
You could give everyone a /26. That would fit all three groups, but each block would consume 64 addresses, even for the ten printers. It is a bit like giving every visitor a large meeting room when some only need a desk.
VLSM means Variable Length Subnet Masking. The idea is simple: use different prefix lengths inside the same parent block. Give each group an appropriately sized subnet, and keep the remaining space available for later.
We’ll plan inside 192.168.10.0/24. If prefixes still feel unfamiliar, start with the CIDR lesson. The equal-size subnetting example is a useful warm-up too.
Step 1: find a size for each group
For each requirement, choose the smallest conventional broadcast subnet that fits. Find a host-bit count h where 2^h − 2 is at least the number of assigned addresses you need. Then your prefix is 32 − h.
- Engineering needs 51: five host bits give only 30 usable addresses; six give 62. Choose /26.
- Support needs 21: four bits give 14; five give 30. Choose /27.
- Printers need 11: three bits give 6; four give 14. Choose /28.
That leaves spare host capacity of 11, 9, and 3 addresses respectively. The smallest fit is a starting point, not a promise that future growth will fit. If Engineering is about to double in size, reserve a larger block or revise the parent plan now.
Step 2: place the biggest block first
Sort the requests from largest to smallest: /26, /27, then /28. Starting with the big blocks makes it easier to avoid carving awkward gaps into space you may need later.
Our /26 contains 64 addresses. Place Engineering at 192.168.10.0/26. It occupies .0 through .63, with hosts .1 through .62 and broadcast .63.
The next free address is .64. Support’s /27 contains 32 addresses, and .64 is a valid multiple-of-32 boundary. Place Support at 192.168.10.64/27, occupying .64 through .95.
Next comes .96. The printer /28 contains 16 addresses, and 96 is divisible by 16. Place it at 192.168.10.96/28, occupying .96 through .111.
192.168.10.0/24 · Each tile is 16 addresses. Read left to right, then down.
256 − 112 = 144 addresses left unallocated.
Step 3: write the usable ranges down
All addresses below begin with 192.168.10.. The proposed gateways are the first usable addresses, simply to keep the plan easy to read. Another usable address could be chosen consistently.
| Group | Network | Mask | Usable last octets | Gateway | Broadcast |
|---|---|---|---|---|---|
| Engineering | .0/26 | 255.255.255.192 | .1–.62 | .1 | .63 |
| Support | .64/27 | 255.255.255.224 | .65–.94 | .65 | .95 |
| Printers | .96/28 | 255.255.255.240 | .97–.110 | .97 | .111 |
Check the joins: .63 is followed by .64; .95 by .96. None of the allocations overlap, and all stay inside the parent’s .0–.255 range. An address such as 192.168.10.100/28 therefore belongs to the printer subnet, whose network starts at .96.
Why you cannot start a /27 just anywhere
A subnet has to start on a boundary that matches its size. In this /24, /27 starts are multiples of 32: .0, .32, .64, .96, and so on. For /28, they are multiples of 16.
Suppose you put the /28 first at .0–.15. You cannot start a /26 at .16 just because it is the next unused address: /26 boundaries are .0, .64, .128, and .192. You could put it at .64, but the gap would need separate planning.
Step 4: account for what is left
The three blocks consume 64 + 32 + 16 = 112 total addresses. The parent contains 256, leaving 144 addresses unallocated, from .112 through .255.
With three equal /26 blocks, we would consume 192 addresses and leave 64 unallocated. VLSM leaves 80 more addresses available for later planning. That is an address-space comparison, not a measured bandwidth or speed improvement.
The remaining 144 addresses are not a single subnet: IPv4 CIDR block sizes are powers of two. You can describe the free space exactly as 192.168.10.112/28 (16 addresses) plus 192.168.10.128/25 (128 addresses). Leave them unallocated until you know the next requirement.
A quick check before touching a router
- Capacity: each subnet has enough usable addresses, including its gateway and any planned reservations.
- Alignment: every network starts on the correct block boundary.
- Containment: no subnet extends outside the parent allocation.
- Overlap: no two allocated ranges share an address.
- Growth: spare capacity and free blocks match a realistic plan for the organisation.
The explorer below starts with .100/28. Check its network and broadcast, then try .95/27 and .96/28. The two addresses sit on opposite sides of the Support–Printers boundary.
VLSM plans address space. To make the network work, you still need compatible routing, interface or VLAN configuration, DHCP scopes and exclusions, and security policy. A subnet boundary alone does not isolate traffic. Avoid assigning special-use addresses without checking the rules for your environment.
This lesson uses conventional broadcast subnets. /31 point-to-point links and /32 host routes have different host rules, and managed cloud providers may reserve extra addresses. Once the address plan looks right, use the knowledge check below to see whether the boundaries have clicked.
Try it yourself
IPv4 subnet explorer
Change the address or prefix. Watch the network bits and host range update.
Blue = network bits (28). Amber = host bits (4).
- Network
- 192.168.10.96/28
- Subnet mask
- 255.255.255.240
- Total addresses
- 16
- Usable host addresses
- 14
- Host range
- 192.168.10.97 – 192.168.10.110
- Broadcast address
- 192.168.10.111
4 host bits → 2^4 = 16 addresses → 14 usable after the network and broadcast reservations. This is address arithmetic; special-use ranges and your network configuration may impose other restrictions.
Check your understanding
Choose an answer for every question, then check your work. You can retry as often as you like.
Sources and scope
These lessons explain IPv4 address arithmetic using IETF specifications. Host counts use conventional network and broadcast reservations, with /31 and /32 exceptions. Address availability also depends on special-use ranges, provider rules, and your configuration.
- RFC 791 — IPv4 address format
- RFC 4632 — CIDR prefixes and address blocks
- RFC 1918 — Private IPv4 address space
- RFC 3021 — /31 point-to-point links
- RFC 1812 — IPv4 router support for variable-length subnet masks