networkingaddressing
CIDR
cidrnetworkingaddressing
Plain English
CIDR is the short way to say how big a network is. In 192.168.1.0/24, the /24 means the first 24 bits name the network and the rest name devices, so it holds 254 usable addresses.
Technical Definition
CIDR (RFC 4632) replaced fixed class A, B and C networks with a variable prefix length.
- /24 = 255.255.255.0, 256 addresses, 254 hosts.
- /16 = 255.255.0.0, 65,536 addresses.
- /30 = 4 addresses, 2 hosts (point-to-point links).
- /32 is one host; /0 is everything.
Hosts = 2 to the power of (32 minus prefix), minus 2 for network and broadcast. IPv6 uses the same notation, usually /64 per LAN.
Source: RFC 4632; CompTIA Network+ N10-009 Exam Objectives v4.0
CIDR in practice
$ ip -4 addr show
inet 10.0.2.15/24 metric 100 brd 10.0.2.255 scope global dynamic enp0s2
$ sudo ufw allow from 192.168.1.0/24 to any port 22In the Wild
You meet CIDR in every ip addr output, firewall rule, and router setting. Network+ N10-009 objective 1.7 expects you to subnet with it. In BNLC Phase 5 you read it from your own VM.