CIDR notation

A compact way to write a block of IP addresses as an address, a slash and a number, such as 10.20.1.0/24.

In more detail

CIDR stands for classless inter-domain routing. The number after the slash, called the prefix length, says how many leading bits are fixed: a /24 holds 256 IPv4 addresses, a /8 holds over 16 million, and /0 means every address. Firewall and security group rules use it to say which sources are allowed, so one wrong prefix can open a service to far more hosts than intended.

Examples

{"CidrIp": "10.20.1.0/24", "Description": "app subnet"}
ip_network("10.0.0.0/8").num_addresses   # 16777216

Related terms

Taught in

References