Insights

Subnetting a site so it can grow

A worked VLSM example that splits a /22 into right-sized subnets with growth built in, keeps free space contiguous, and plans IPv6 alongside.

Published

Address plans tend to go wrong in one of two ways. Either every VLAN gets a /24 whether it needs one or not, and the block runs out, or each subnet is sized exactly to today’s head count and has to be renumbered the first time the site grows. Variable-length subnet masking (VLSM) avoids both. This example uses the VLSM planner.

The site below is a made-up example, not a customer site.

List what the site needs

Start from the hosts each segment needs today:

Subnet Hosts today
Users 300
Voice 120
Printers 40
Servers 25
Management 12
Router link 2

The site has been given 10.40.0.0/22, which is 1,024 addresses.

Add growth before you size

Size each subnet for where it will be, not where it is. With a 25% growth allowance, 300 users becomes 375, 120 phones becomes 150, and so on. Point-to-point links are left at two addresses, because they do not grow.

Each subnet then needs room for its hosts plus a network and a broadcast address, rounded up to a power of two:

Prefix = 32 − ceil(log₂(hosts + 2))

375 users need 377 addresses, which rounds up to 512, so Users gets a /23.

Allocate largest first

Placing the largest subnets first keeps every subnet on its natural boundary and leaves the free space in one end of the block:

Subnet Planned hosts Network Usable hosts
Users 375 10.40.0.0/23 510
Voice 150 10.40.2.0/24 254
Printers 50 10.40.3.0/26 62
Servers 32 10.40.3.64/26 62
Management 15 10.40.3.128/27 30
Router link 2 10.40.3.160/31 2

The plan uses 930 of 1,024 addresses (90.8%). The router link is a /31, which RFC 3021 allows for point-to-point links and which saves two addresses over a /30.

Know what is left

The 94 free addresses sit at the top of the block as aligned pieces you can hand out later without renumbering anything:

  • 10.40.3.162/31
  • 10.40.3.164/30
  • 10.40.3.168/29
  • 10.40.3.176/28
  • 10.40.3.192/26

If the site later needs a new segment of up to 62 hosts, 10.40.3.192/26 is ready. If it needs more than that, the plan needs a second block, and it is better to find that out on paper.

Plan IPv6 at the same time

IPv6 removes the address shortage but not the need for a plan. Every LAN segment should get a /64, whatever its size, because stateless address autoconfiguration (SLAAC) depends on it. A site that receives a /56 has 256 /64 subnets to work with, which the IPv6 prefix calculator confirms. A common approach is to mirror the IPv4 VLAN numbers in the fourth group of the IPv6 prefix so the two plans are easy to read side by side.

Write it down

The plan is only useful if it stays current. Keep it in one place, with the VLAN, purpose, gateway and DHCP scope for each subnet, and update it as part of every change. The subnet mask table and IPv4 subnet calculator help when checking individual entries.