Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

VLSM

Direct answer

Variable-Length Subnet Masking (VLSM) gives each subnet the size it needs (a /30 or /31 for links, a /24 for a user VLAN) instead of one fixed size, wasting fewer addresses.

When to use this

Use it when planning addressing with different subnet sizes, such as user VLANs, server VLANs and point-to-point links.

First 30 seconds

1. List subnets by size, largest first.

2. Allocate each from the start of free space on its block boundary.

3. Check: no overlap, every subnet on a valid boundary.

4. Site subnets fit inside one summary prefix?

5. show ip route <summary> longer-prefixes — matches the plan.

Operational verification

requirements sorted by size → largest allocated first on block boundaries → smaller fill remaining space → no overlaps → summary per site

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common VLSM mistakes
  • Allocating small subnets first, leaving unaligned gaps for larger ones.
  • Overlapping subnets because a block boundary was miscalculated.
  • Not leaving room for growth in each site's block.
  • Summarisation impossible because sites got non-contiguous blocks — plan hierarchically (per site, then per VLAN).
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard
Key commandshow ip route 10.0.0.0 255.0.0.0 longer-prefixes
Scope / prerequisiteUse it when planning addressing with different subnet sizes, such as user VLANs, server VLANs and point-to-point links.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Commands Verify boundary
show ip route 10.0.0.0 255.0.0.0 longer-prefixes
show ip interface brief

Check that no two interfaces have overlapping prefixes.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

Allocate the largest subnets first, then smaller ones, each on its own block boundary, so they do not overlap. Use /31 (or /30) for point-to-point links and /32 for loopbacks. Keep each site's subnets inside one summary block so routing can be summarised.

Key checks
  • show ip interface brief — addresses on each interface.
  • show ip interface <if> | include Internet address — address with prefix length.
  • show ip route connected — the subnets the router derives from its addresses.
  • show ip route <prefix> longer-prefixes — overlapping or more specific routes.
  • Subnet calculator (e.g. ipcalc <ip>/<len> on Linux) — network, broadcast and host range.
ReferenceWhat it is1 section · depth on demand

Allocating with VLSM

Allocate the largest subnets first so blocks stay aligned. Example from 10.0.0.0/24:

NeedPrefixSubnet
100 hosts/2510.0.0.0/25
50 hosts/2610.0.0.128/26
20 hosts/2710.0.0.192/27
Point-to-point link/30 or /3110.0.0.224/30
Point-to-point link/30 or /3110.0.0.228/30
ReferenceWhy it matters1 section · depth on demand

How it works

VLSM (Variable Length Subnet Masking) uses different prefix lengths inside one block, so each link gets only the addresses it needs: /30 or /31 for point-to-point links, /24 for user VLANs, /28 for small server segments. All modern routing protocols (OSPF, EIGRP, BGP, RIPv2) carry the mask with each route, which makes VLSM possible.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Worked site plan — 10.20.0.0/20 (4096 addresses)

Allocate largest blocks first, each aligned on its own size:

UseSizePrefixBlock
Users floor 1254 hosts/2410.20.0.0/24
Users floor 2254 hosts/2410.20.1.0/24
Voice254 hosts/2410.20.2.0/24
Wireless510 hosts/2310.20.4.0/23
Servers62 hosts/2610.20.8.0/26
Printers / IoT30 hosts/2710.20.8.64/27
Point-to-point links2 each/3110.20.15.0/31, 10.20.15.2/31 …
Loopbacks1 each/3210.20.15.224/32 … from 10.20.15.224/27
Reserve——10.20.3.0/24, 10.20.6.0/23, 10.20.9.0 – 10.20.14.255

The /23 starts at 10.20.4.0 rather than 10.20.3.0 because a /23 must begin on an even third octet; 10.20.3.0/24 stays free for a later /24.

Alignment test

A subnet is valid only if its start address is a multiple of its block size in the interesting octet:

CandidateBlock sizeStart ÷ sizeValid?
10.20.4.0/232 (third octet)4 ÷ 2 = 2yes
10.20.3.0/2323 ÷ 2 = 1.5no
10.20.8.64/2732 (fourth octet)64 ÷ 32 = 2yes
10.20.8.80/273280 ÷ 32 = 2.5no

Why it matters for routing

Because every subnet lies inside 10.20.0.0/20, the site can be advertised as one route (RFC 4632). A single subnet borrowed from another site's block breaks that summary or forces extra specifics.

Verify on the device

show ip interface brief and show ip route connected list the configured subnets; IOS refuses an interface address that overlaps another interface (% 10.20.8.64 overlaps with Vlan50), which catches allocation errors early.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 791

Authoritative/upstream documentation reviewed for bounded claims in IP Fundamentals → IPv4 → Addressing → VLSM. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc791.html · confidence 94%
Confirmation

Confirm action

Continue?