VLSM Explained

Variable Length Subnet Masking (VLSM) is the ability to use different subnet masks within a single major network. Without VLSM (called Fixed Length Subnet Masking, FLSM), every subnet in a network must use the same prefix, which wastes addresses when subnets vary widely in size. VLSM lets you size each subnet to its actual need. Verify any VLSM layout with the subnet calculator.

Built by a network engineerCalculations run locally in your browserNo signup requiredNetwork information is not transmitted to our servers

FLSM vs VLSM

PropertyFLSMVLSM
Mask per networkOne fixed prefixDifferent prefixes allowed
Address efficiencyLow (sized to largest subnet)High (right-sized)
Routing protocol supportRIPv1, IGRPRIPv2, EIGRP, OSPF, IS-IS, BGP
Required for route summarizationNoYes

The VLSM allocation method

The standard procedure, in order:

  1. List every subnet with its required host count.
  2. Sort largest to smallest. Allocating the biggest first prevents fragmentation.
  3. Pick the smallest prefix that fits each subnet (2^h − 2 ≥ hosts needed).
  4. Allocate sequentially from your starting block, advancing by each subnet's block size.
  5. Double-check no overlaps — the next network address equals the previous broadcast + 1.

Step-by-step worked example

You are given 192.168.1.0/24 and need four subnets:

SubnetHosts needed
LAN-A (users)100
LAN-B (servers)50
LAN-C (printers)20
WAN link (P2P)2

Step 1 — Size each subnet

SubnetHostsPrefixHost bitsUsable
LAN-A100/257126
LAN-B50/26662
LAN-C20/27530
WAN2/3022

Step 2 — Allocate sequentially (largest first)

SubnetPrefixNetworkUsable rangeBroadcast
LAN-A/25192.168.1.0.1 – .126.127
LAN-B/26192.168.1.128.129 – .190.191
LAN-C/27192.168.1.192.193 – .222.223
WAN/30192.168.1.224.225 – .226.227

Total used: 256 addresses — the entire /24, with zero waste. With FLSM you would have used a /25 for all four subnets, consuming 4 × 128 = 512 addresses (a /23) and wasting most of them on the 2-host WAN link.

Step 3 — Verify alignment

Each network address must be a multiple of its block size: 0 (÷128), 128 (÷64), 192 (÷32), 224 (÷4). All pass. The next free address would be 192.168.1.228.

Configuration example

! LAN-A — users
interface Vlan10
 ip address 192.168.1.1 255.255.255.128

! LAN-B — servers
interface Vlan20
 ip address 192.168.1.129 255.255.255.192

! WAN link to branch
interface Serial0/0/0
 ip address 192.168.1.225 255.255.255.252

Routing protocol requirements

VLSM requires a classless routing protocol that carries the prefix length in its updates. OSPF, EIGRP, IS-IS, RIPv2, and BGP all support VLSM. RIPv1 and IGRP are classful and cannot advertise variable-length masks — they will summarize to the classful boundary and break your design.

! Enable RIPv2 (classless) to carry VLSM
router rip
 version 2
 no auto-summary
 network 192.168.1.0

Common VLSM mistakes

  • Allocating smallest-first — fragments the block and can make a large subnet not fit.
  • Forgetting the −2 — a /27 gives 30 usable, not 32.
  • Using classful routing — RIPv1/auto-summary collapses your subnets.
  • Overlapping subnets — always compute the next network as previous broadcast + 1.

Related guides & tools

Technically Reviewed By

Senior Enterprise Network Engineer — 25+ years of IT and network infrastructure experience, including enterprise Cisco switching, routing, wireless, firewalls, VPN, network access control, SD-WAN, and large-scale network operations.

Last reviewed: 2026-09-02

Calculations are performed using standards-based formulas and verified against known reference values. All computation runs client-side in your browser.