Use it when planning addressing with different subnet sizes, such as user VLANs, server VLANs and point-to-point links.
VLSM
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.
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.
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
- 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).
Operational reference
Fast context before you go deeper.
show ip route 10.0.0.0 255.0.0.0 longer-prefixesVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 · 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.
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.
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:
| Need | Prefix | Subnet |
|---|---|---|
| 100 hosts | /25 | 10.0.0.0/25 |
| 50 hosts | /26 | 10.0.0.128/26 |
| 20 hosts | /27 | 10.0.0.192/27 |
| Point-to-point link | /30 or /31 | 10.0.0.224/30 |
| Point-to-point link | /30 or /31 | 10.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:
| Use | Size | Prefix | Block |
|---|---|---|---|
| Users floor 1 | 254 hosts | /24 | 10.20.0.0/24 |
| Users floor 2 | 254 hosts | /24 | 10.20.1.0/24 |
| Voice | 254 hosts | /24 | 10.20.2.0/24 |
| Wireless | 510 hosts | /23 | 10.20.4.0/23 |
| Servers | 62 hosts | /26 | 10.20.8.0/26 |
| Printers / IoT | 30 hosts | /27 | 10.20.8.64/27 |
| Point-to-point links | 2 each | /31 | 10.20.15.0/31, 10.20.15.2/31 … |
| Loopbacks | 1 each | /32 | 10.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:
| Candidate | Block size | Start ÷ size | Valid? |
|---|---|---|---|
| 10.20.4.0/23 | 2 (third octet) | 4 ÷ 2 = 2 | yes |
| 10.20.3.0/23 | 2 | 3 ÷ 2 = 1.5 | no |
| 10.20.8.64/27 | 32 (fourth octet) | 64 ÷ 32 = 2 | yes |
| 10.20.8.80/27 | 32 | 80 ÷ 32 = 2.5 | no |
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.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%