NETWORKING / A CONCEPT NOTE
Subnets & CIDR
what /24 really means
Overview · mechanism
pitfall · examples
01 / THE SHORT VERSION
The idea in a few sentences.
Classless Inter-Domain Routing (CIDR) defines network sizes. A /24 subnet mask means the first 24 bits are the network address, leaving 8 bits (256 IPs) for host addresses.
02 / FOLLOW THE MECHANISM
How cidr masking flows
IP Address
is represented as 32 binary bits.
Subnet Mask
is applied using binary AND logic.
Network
portion matches the mask bits (first 24 bits for /24).
Host
portion is variable (last 8 bits). IPs .0 (network) and .255 (broadcast) are reserved.
04 / COMMAND NOTES
Read the command, then the result.
Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.
calculate IP ranges, masks, and hosts
ipcalc 192.168.1.0/24scan active hosts in a subnet
nmap -sn 192.168.1.0/2405 / CHECK YOURSELF
Could you explain Subnets & CIDR to a teammate?
Try it out loud in two sentences: what it is, and the one detail that changes the picture. If you stall, the gap is the part to reread.
Up next in NetworkingRoutinghow packets find their way