ExitClassless Inter-Domain Routing (CIDR): precise address ranges1 / 9
Explanation

Read a prefix as fixed bits

How to interpret CIDR prefixes, test address membership, and select correctly aligned blocks for allowlists without including unintended source addresses. · associate

Classless Inter-Domain Routing (CIDR) describes an address range using an address and a prefix length, such as 203.0.113.0/24. IPv4 addresses have 32 bits. The /24 prefix fixes the first 24 bits and leaves 8 bits free to vary.

The address count is 2 raised to the number of remaining bits: a /24 contains 256 addresses, while a /28 contains 16. A larger prefix number means a smaller range. A /32 matches one IPv4 address; 0.0.0.0/0 matches every IPv4 address.

These are counts of addresses matched by a CIDR, not counts of assignable workload addresses in a subnet. IPv6 uses the same prefix principle with 128 bits; one IPv6 address is a /128.

IPv4 prefixFixed bitsVariable bitsAddresses matched
/24248256
/2828416
/323201
/0032All IPv4 addresses