Skip to content

CIDR

Classless Inter-Domain Routing

Medium — good to knowNetworking

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?"

Made with passive-aggressive love by manoga.digital. Powered by Claude.