← Knowledge Base
NetworkingReference note1 min read · updated 2026-11-27

Subnetting in a few lines

CIDR notation, how many addresses a prefix gives, and the private ranges.

subnettingcidripv4

A prefix /n leaves 32 − n host bits: addresses = 2^(32−n); usable hosts = that minus 2 (network and broadcast).

Prefix Mask Addresses Usable hosts
/24 255.255.255.0 256 254
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/30 255.255.255.252 4 2

Private (RFC 1918) ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Other special ranges: 127.0.0.0/8 loopback, 169.254.0.0/16 link-local (a self-assigned address usually means DHCP failed), 100.64.0.0/10 carrier-grade NAT. ipcalc 192.168.1.0/26 (apt install ipcalc) does the arithmetic for you.