NETWORKING / A CONCEPT NOTE

Subnets & CIDR

what /24 really means

~70 sec read

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

  1. IP Address

    is represented as 32 binary bits.

  2. Subnet Mask

    is applied using binary AND logic.

  3. Network

    portion matches the mask bits (first 24 bits for /24).

  4. 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.

EXAMPLE 01 · REFERENCE

calculate IP ranges, masks, and hosts

ipcalc 192.168.1.0/24

EXAMPLE 02 · REFERENCE

scan active hosts in a subnet

nmap -sn 192.168.1.0/24

Explore command anatomy in the CLI lab