Networking Tutorials

VLSM Explained: Variable Length Subnet Masking

VLSM (Variable Length Subnet Masking) lets you use different subnet masks for different subnets inside the same network, so each subnet is only as big as it needs to be. The rule: always allocate the largest requirement first, then work down — this prevents overlap and wasted addresses.

Worked example: 192.168.1.0/24 for 60, 28, 12 and 2 hosts

  1. 60 hosts → needs 6 host bits (2^6−2=62) → /26 → 192.168.1.0/26 (range .0–.63).
  2. 28 hosts → 5 host bits (30 usable) → /27 → 192.168.1.64/27 (.64–.95).
  3. 12 hosts → 4 host bits (14 usable) → /28 → 192.168.1.96/28 (.96–.111).
  4. 2 hosts (a WAN link) → 2 host bits (2 usable) → /30 → 192.168.1.112/30 (.112–.115).

Notice no space is wasted — a fixed /26 for everything would have run out fast. Try your own with the VLSM calculator.

Why largest-first matters

If you allocate a small subnet before a large one, the large subnet may not fit in the remaining contiguous space, forcing overlaps. Sorting requirements largest-to-smallest guarantees each block starts on a valid boundary. This is the single most common VLSM mistake in exams.

Frequently asked questions

What is VLSM used for?

VLSM lets you assign right-sized subnets — a /30 for a two-host WAN link, a /26 for a 60-host LAN — inside one network, avoiding the address waste of fixed-size subnetting.

What is the golden rule of VLSM?

Always allocate the largest host requirement first, then the next largest, and so on. This prevents subnet overlap and keeps every block on a valid boundary.

Is VLSM in the CCNA exam?

Yes — VLSM and efficient IP addressing are part of the 200-301 blueprint, and it appears heavily at CCNP level too.

VS
Vipul Sir — Lead Instructor, Attila Technologies20+ years in Cisco networking. Teaching CCNA, CCNP, CCIE & CyberOps in Ahmedabad since 2004.

Want hands-on training?

Learn this on real Cisco lab devices with placement support at Attila Technologies, Ahmedabad.

Start your networking career with Attila Technologies

Hands-on Cisco training, real lab devices and placement support in Ahmedabad.