Skip to main content
VLSM (Variable-Length Subnet Masking) allows you to subnet a network into different sized subnets based on the number of hosts required for each subnet. This is more efficient than traditional fixed-length subnetting and is essential for network design and IP address conservation.

VLSM Calculator Tool

VLSM Calculator

Click here to access the interactive VLSM calculator tool
The VLSM calculator helps you design efficient subnet allocations based on your host requirements.

What is VLSM?

VLSM (Variable-Length Subnet Masking) is a subnet design technique that allows you to:
  • Allocate different subnet sizes based on actual requirements
  • Minimize IP address waste by using appropriately sized subnets
  • Design hierarchical networks with efficient address allocation
  • Support route summarization for better routing efficiency

VLSM vs Traditional Subnetting

All subnets are the same sizeExample: 10.0.0.0/24 divided into 4 subnets:
  • 10.0.0.0/26 (62 hosts)
  • 10.0.0.64/26 (62 hosts)
  • 10.0.0.128/26 (62 hosts)
  • 10.0.0.192/26 (62 hosts)
Problem: If you only need 10 hosts in one subnet and 50 in another, you waste 52 IPs in the first subnet.

VLSM Design Process

1

List Requirements

List all subnets and their host requirements in descending order (largest first)
2

Allocate Largest First

Start with the largest subnet requirement and allocate appropriately sized CIDR block
3

Continue Sequentially

Move to the next largest requirement and allocate the next available block
4

Verify No Overlap

Ensure no subnet ranges overlap
5

Document Allocation

Document all allocations for future reference

Example VLSM Design

Network Requirements

You have network 192.168.1.0/24 and need:
  • Subnet A: 100 hosts
  • Subnet B: 50 hosts
  • Subnet C: 25 hosts
  • Subnet D: 10 hosts
  • 2 point-to-point links: 2 hosts each

VLSM Allocation

SubnetHosts NeededHosts AvailableCIDRRange
Subnet A100126/25192.168.1.0 - 192.168.1.127
Subnet B5062/26192.168.1.128 - 192.168.1.191
Subnet C2530/27192.168.1.192 - 192.168.1.223
Subnet D1014/28192.168.1.224 - 192.168.1.239
Link 122/30192.168.1.240 - 192.168.1.243
Link 222/30192.168.1.244 - 192.168.1.247
Remaining address space: 192.168.1.248 - 192.168.1.255 (available for future use)

VLSM Subnet Size Quick Reference

Hosts NeededUse This CIDRUsable Hosts
2/302
6/296
14/2814
30/2730
62/2662
126/25126
254/24254
510/23510
1,022/221,022
2,046/212,046
4,094/204,094

Benefits of VLSM

IP Efficiency

Minimizes IP address waste by allocating appropriate subnet sizes

Scalability

Supports hierarchical network design and growth

Route Summarization

Enables efficient route summarization (supernetting)

Flexibility

Adapts to varying host requirements per subnet

VLSM in Cloud Environments

AWS VPC Example

VPC: 10.0.0.0/16

├─ Public Subnets (web servers - 250 hosts each)
│  ├─ 10.0.0.0/24 (AZ-A)
│  └─ 10.0.1.0/24 (AZ-B)

├─ Private Subnets (app servers - 500 hosts each)
│  ├─ 10.0.2.0/23 (AZ-A)
│  └─ 10.0.4.0/23 (AZ-B)

├─ Database Subnets (databases - 60 hosts each)
│  ├─ 10.0.6.0/26 (AZ-A)
│  └─ 10.0.6.64/26 (AZ-B)

└─ Management Subnet (bastion - 10 hosts)
   └─ 10.0.6.128/28
AWS reserves 5 IPs per subnet (first 4 and last 1), so plan accordingly.

VLSM Best Practices

1

Plan Ahead

Always plan for growth - allocate 30-50% more hosts than currently needed
2

Sort by Size

Allocate subnets in descending order (largest first) to minimize waste
3

Document Everything

Maintain detailed documentation of all subnet allocations
4

Use Private Ranges

Use RFC 1918 private address spaces (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
5

Plan for Summarization

Design with route summarization in mind for efficient routing

VLSM Lab Exercise

Scenario: You have network 172.16.0.0/16 and need to create subnets for:
  1. Head Office LAN: 500 hosts
  2. Branch Office 1: 200 hosts
  3. Branch Office 2: 100 hosts
  4. Branch Office 3: 50 hosts
  5. DMZ Network: 30 hosts
  6. Management Network: 10 hosts
  7. Three WAN links: 2 hosts each
Your Task:
  • Design VLSM allocation
  • Calculate subnet masks
  • Determine IP ranges
  • Document network and broadcast addresses
Use the VLSM Calculator to verify your design.

CIDR Reference Table

Complete CIDR notation reference

VPC Subnetting

Learn about AWS VPC subnet design

VLSM Calculator Tool

Interactive VLSM calculator

Route Tables

Understanding routing with VLSM

Further Reading

Build docs developers (and LLMs) love