Reference

Core

Variable Length Subnet Masking (VLSM)

VLSM allows a single classful or summarized address block to be subdivided into subnets of different sizes, matching each subnet size to the actual number of hosts required and avoiding address waste.

What you need to know

  • Always allocate the largest host requirement first, then progressively smaller ones.
  • Each subnet borrows a different number of host bits depending on required hosts, unlike fixed-length subnetting.
  • Point-to-point WAN links typically use /30 (or /31) masks to minimize wasted addresses.
  • VLSM requires a classless routing protocol (OSPF, EIGRP, RIPv2, static) since RIPv1 does not support it.
  • Document each subnet's network address, mask, range, and broadcast before configuring interfaces.
  • Route summarization works best when VLSM subnets are allocated contiguously from the same block.
  • Overlapping subnets from poor VLSM planning cause routing black holes or unreachable networks.

Configuration commands

CommandModePurpose
ip address 192.168.10.1 255.255.255.128config-ifConfigure the largest VLSM subnet (/25, 126 hosts).
ip address 192.168.10.129 255.255.255.192config-ifConfigure a medium VLSM subnet (/26, 62 hosts).
ip address 192.168.10.193 255.255.255.252config-ifConfigure a small VLSM subnet (/30) for a WAN link.
router ospf 1configEnable OSPF, a classless protocol that supports VLSM.
network 192.168.10.0 0.0.0.255 area 0config-routerAdvertise VLSM subnets within the classful range into OSPF area 0.
ip route 192.168.10.0 255.255.255.0 10.0.0.2configConfigure a summarized static route covering multiple VLSM subnets.

Verify it

  • show ip route
  • show ip protocols
  • show ip interface brief
  • show ip ospf database
  • traceroute <destination>

Common mistakes

  • Allocating subnets out of order and running out of address space for larger segments.
  • Overlapping two VLSM subnets carved from the same block.
  • Using RIPv1 or another classful protocol that cannot carry VLSM subnet masks.
  • Wasting a large subnet on a point-to-point link that only needs 2 addresses.
  • Failing to update summarization statements after adding new VLSM subnets.

Practise Variable Length Subnet Masking (VLSM) in a real CLI

Generated labs, graded against the simulated network state.

Start a free lab