By the end of this guide, you will be able to divide one network among teams with different needs without overlapping addresses. From 192.168.0.0/24, for example, we will give an office a /26 for 50 hosts and Wi-Fi a smaller /28 for 12, while preserving one contiguous block for growth. VLSM means Variable Length Subnet Mask: using different mask lengths in one plan. It is not a separate protocol; it uses subnet masks and CIDR prefixes. A valid plan contains non-overlapping, correctly aligned blocks that all fit inside the base network.
VLSM versus equal-sized subnets
FLSM (Fixed Length Subnet Mask) chooses one size for every subnet. VLSM fits each block to demand, so a department needing addresses for 50 devices can use /26 while a 12-device segment uses /28. The trade-off is a more exact plan and routing that carries prefix lengths.
Choosing a prefix
For a conventional /0 through /30 IPv4 subnet, choose the smallest h for which 2^h − 2 covers the hosts; the prefix is 32 − h. Fifty hosts need /26, twenty need /27, and ten need /28. Count gateways, infrastructure interfaces, and planned headroom as addresses too.
Why allocate largest first
Descending order is not a protocol requirement, but it is a reliable planning algorithm. A large block has fewer valid boundaries and may no longer fit after space is fragmented. A /26 starts every 64 addresses, /27 every 32, and /28 every 16.
Example: 192.168.0.0/24
Assume Office needs 50 host addresses, Lab 25, Wi-Fi 12, and Management 6. Each count already includes the gateway and other interfaces. The minimum allocation is /26, /27, /28, and /29. The calculator selects these prefixes for those exact requirements; it does not add a gateway or headroom automatically.
The table below shows a plan with headroom: Management receives /28 instead of the minimum /29. To reproduce it in the calculator, enter 7 for Management: 6 needed addresses plus at least 1 for growth. A /29 is now too small, so the calculator selects a /28 with 14 host slots. That leaves 8 slots above today's demand of 6. Keep the other requirements unchanged.
| Segment | Block | Host range | Broadcast | Host capacity |
|---|---|---|---|---|
| Office | 192.168.0.0/26 | .1–.62 | .63 | 62 |
| Lab | 192.168.0.64/27 | .65–.94 | .95 | 30 |
| Wi-Fi | 192.168.0.96/28 | .97–.110 | .111 | 14 |
| Management | 192.168.0.112/28 | .113–.126 | .127 | 14 |
In the minimum plan, Management occupies 192.168.0.112/29: hosts .113–.118 and broadcast .119. This also leaves 192.168.0.120/29 free alongside 192.168.0.128/25. The headroom plan assigns the first of these free blocks to Management, reducing the unallocated space.
The contiguous 192.168.0.128/25 remains free. In practice, you can divide that block into more correctly aligned subnets later. Do not add it to unused host slots inside assigned subnets: those slots still belong to their existing blocks and cannot be assigned to another segment. Plan your own requirements with the VLSM calculator.
Headroom and future growth
You cannot arbitrarily enlarge a subnet later. Growing /28 to /27 needs the adjacent block to be free and the start aligned to a /27 boundary, and usually requires renumbering. Reserve headroom deliberately for growth, gateways, management, and services rather than inflating every segment without a limit.
VLANs, subnets, and routing
A VLAN is a layer-2 domain, a subnet is a layer-3 addressing plan, and routing moves traffic between subnets. One VLAN often maps to one subnet, but VLSM calculations do not create a VLAN, gateway interface, DHCP scope, or firewall policy.
/31 and calculator limits
RFC 3021 defines /31 for point-to-point links. Ordinary user networks use the network–hosts–broadcast model, so a planner may intentionally avoid selecting /31 automatically. Treat point-to-point links as a separate requirement and confirm support on both devices.
Checklist
- Normalize the base network and list every demand, including gateways and headroom.
- Allocate largest first; verify each start boundary and end address.
- Confirm no overlap and that every block remains inside the base network.
- Record free space as actual prefixes, not only a total address count.
- Connect the plan to VLAN, routing, DHCP, and security configuration.