How to use the vlsm subnet planner
- Enter the parent block in CIDR form, such as 192.168.10.0/24.
- List the subnets you need. Give each a name and the number of hosts it must hold, not counting the network and broadcast addresses.
- Read the plan: each subnet's network address, mask, usable range, broadcast address and size, and the blocks left free.
- Copy, print or download the table as a CSV to keep with your network notes.
Formula
Addresses needed = hosts + 2 (network and broadcast)
Block size = the next power of two at or above that, with a minimum of 4 (a /30)
Prefix length = 32 - log2(block size)
Place subnets from largest to smallest, each at the next address that is a multiple of its size
Subnets are packed one after another, so the unused space collects at the end of the parent block, and it is listed as the largest blocks that fit.
Four subnets in a /24
Inside 192.168.10.0/24, an office needs 100 hosts, guests 50, servers 25 and a link to the provider 2. The office needs 102 addresses, so a block of 128 (a /25). Guests need 52, so 64 (a /26). Servers need 27, so 32 (a /27), and the link needs 4 (a /30).
They are placed at 192.168.10.0/25, 192.168.10.128/26, 192.168.10.192/27 and 192.168.10.224/30. That uses 228 of the 256 addresses. The 28 left are 192.168.10.228/30, 192.168.10.232/29 and 192.168.10.240/28. The usable range of the first subnet is .1 to .126 with broadcast .127.
Why largest first
Subnet blocks must start at a multiple of their own size. If you place small blocks first, they can leave gaps that a bigger block cannot use, because it has to start on a bigger boundary. Placing the biggest block first, then the next biggest, packs the space tightly and keeps every block aligned.
Variable length subnet masks (VLSM) let you do this: each subnet gets just the size it needs instead of the same size for every subnet. The Subnet Calculator inspects one block or splits it into equal parts. To merge existing blocks into fewer, use the CIDR Aggregator.
Planning for growth
A plan sized exactly to today's hosts leaves no room for tomorrow. Add a margin to each count before you enter it, and keep the free blocks at the end for new subnets. If a subnet grows beyond its block, you must renumber it, which is harder than leaving space at the start.
The smallest block here is a /30 with two usable addresses, which fits a point-to-point link. Some equipment also supports a /31 for links; this plan does not use it, so check your device notes. The IP Address Format Converter and the Common Ports List are useful companions when you write the plan down.
Assumptions and limits
- The plan is for IPv4. The parent block must be given with a prefix length and have no host bits set.
- Each subnet gets a block of at least hosts + 2 addresses, rounded up to a power of two, with a minimum of 4.
- Addresses are packed from the start of the parent block with no reserved space for routers or growth.
- The tool plans address space on paper. It does not check what is already in use on your network.
Frequently asked questions
What does VLSM stand for?
It stands for variable length subnet mask. It means the subnets cut from one block can have different sizes, so each one is sized for the number of hosts it needs.
Why are hosts plus 2 addresses needed?
In an ordinary IPv4 subnet the first address is the network address and the last is the broadcast address, so neither can be given to a host.
Why did my plan fail with no room left?
The blocks needed add up to more than the parent block, or the alignment rules leave gaps. Use a larger parent block or reduce the host counts.
Can I plan IPv6 with it?
No. This planner works with IPv4. IPv6 subnets are normally a fixed /64, so the sizing question is different.