ops@toolbox:~$ ip subnet --vlsm

VLSM Subnet Planner

Variable Length Subnet Masking (VLSM) allows allocating subnets of different sizes from a single parent network to prevent wasting IP addresses.

Subnet Requirements

Enter your subnets and their host requirements. Largest subnets will be allocated first to ensure optimal alignment.

How VLSM works

In standard classless routing (CIDR), if you divide a network, all subnets are typically the same size. If you have one branch requiring 100 hosts and three branches requiring 2 hosts each, giving everyone a /25 (126 usable hosts) wastes 124 IPs on each 2-host subnet. VLSM solves this by sorting requirements from largest to smallest and carving out precisely sized subnets (e.g. a /25 for the large branch, and /30s for the small branches) sequentially.

Rules of VLSM allocation

To avoid overlapping blocks, the network address of any allocated subnet must be evenly divisible by its block size (determined by its subnet mask). For example, a /26 subnet (block size of 64) can only start at host offsets like .0, .64, .128, or .192. This is why VLSM algorithms always sort the host requirements in descending order (largest first) before assigning IP boundaries.

Related tools

Subnet Calculator
IPv4 CIDR calculator with subnet split and find-prefix options.
IP Range → CIDR Converter
Convert an IPv4 address range into a minimal list of CIDR blocks.
IPv6 Calculator
Expand, compress and subnet IPv6 networks.