CIDR
Classless Inter-Domain Routing
ELI5 — The Vibe Check
CIDR is the shorthand notation for specifying IP address ranges. '192.168.1.0/24' — the number after the slash tells you how many bits are the network part. /24 means 256 addresses, /16 means 65,536 addresses. The bigger the number after /, the smaller the network.
Real Talk
CIDR is a method for allocating IP addresses and routing that replaced the old classful network scheme. CIDR notation expresses a network address as IP/prefix-length where the prefix length indicates how many bits are fixed (network portion). Enables more efficient IP address allocation.
Show Me The Code
# CIDR notation cheat sheet
/32 = 1 host (single IP)
/30 = 4 addresses (2 usable)
/29 = 8 addresses (6 usable)
/28 = 16 addresses (14 usable)
/27 = 32 addresses (30 usable)
/26 = 64 addresses (62 usable)
/25 = 128 addresses (126 usable)
/24 = 256 addresses (254 usable) ← most common
/23 = 512 addresses
/22 = 1024 addresses
/16 = 65536 addresses
/8 = 16M addresses
# AWS security group: allow SSH from your IP
# Your IP/32 = just your single IP address
When You'll Hear This
"Add a firewall rule to allow traffic from the 10.0.0.0/8 CIDR block." / "What CIDR should I use for the VPC — 10.0.0.0/16?"
Related Terms
Firewall
A firewall is the bouncer at your network's door. It checks every incoming and outgoing connection against a list of rules and blocks anything suspicious.
IP Address
An IP address is your device's home address on the internet.
IPv4 (Internet Protocol version 4)
IPv4 is the original address format for the internet — four numbers separated by dots, like 192.168.1.1. The problem?
NAT (Network Address Translation)
NAT is how your home router lets all your devices share one public IP address. Your phone, laptop, and TV each get a private IP (192.168.x.
Subnet
A subnet is a smaller chunk of a larger network, like dividing a city into neighborhoods. All devices in a subnet can talk to each other directly.