Concepts / Addressing

Addressing

VLSM

Also called variable-length subnet mask, subnetting, /26, /27, /28, /30, /31, point-to-point link

Cutting one block of addresses into subnets of different sizes, each as big as its network needs.

A /n subnet holds 2^(32 − n) addresses, two of them reserved, so 50 PCs need a /26 (62), 20 phones a /27 (30) and a few printers a /28 (14). Carve the biggest first, each starting on a multiple of its own size, and they never overlap. A link between two routers takes a /30 (two hosts) or a /31 (RFC 3021: both addresses are hosts, no network or broadcast address). Subnets carved from one block can later be summarised into one route.

The same 256 addresses, cut to fit
The same 256 addresses, cut to fit

Equal blocks leave the guests short and the link nearly empty. Cut to size, biggest first, and every group fits. From the CIDR and VLSM: fit a whole hotel into one block of addresses lab.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab