Networking: CIDR

By tjohnson , 21 May, 2025

Understanding CIDR: Classless Inter-Domain Routing

Whether you're configuring static IP addresses or designing a network layout, you'll eventually run into CIDR notation — numbers like /24, /16, or /30 stuck onto the end of an IP address. This shorthand is more than just formatting — it defines how your network is structured.

What is CIDR?

CIDR stands for Classless Inter-Domain Routing. It’s a flexible way of assigning IP addresses and defining subnet masks without relying on the rigid old “classful” system (Class A, B, C).

Introduced in the 1990s, CIDR helps conserve IP address space and gives system administrators much more control over how big or small their networks can be.

What Does the /XX Mean?

The number after the slash in CIDR notation — like the 24 in 192.168.1.0/24 — represents the number of bits used for the network portion of the IP address.

  • /24 means the first 24 bits define the network, leaving 8 bits for host addresses.
  • /16 means 16 bits for network, 16 bits for hosts.
  • /32 means the full address is a single host — no range.

The more bits you assign to the network portion, the fewer hosts can exist on that subnet. The fewer bits assigned to the network, the larger the host pool.

Common CIDR Blocks and Their Meaning

CIDR Subnet Mask Number of Hosts Typical Use
/30 255.255.255.252 2 usable Point-to-point links
/29 255.255.255.248 6 usable Small device groups
/24 255.255.255.0 254 usable Typical home/LAN network
/16 255.255.0.0 65,534 usable Large internal networks

Why Use CIDR Instead of a Subnet Mask?

CIDR notation is simply more compact and modern. Instead of writing 255.255.255.0, you can just say /24. It’s the same thing — just clearer and easier to parse for both machines and humans.

It also gives you more flexibility in carving out your address space exactly how you need it, not just in “class A/B/C” blocks.

How to Calculate Hosts from a CIDR

Use the formula: 2^(32 - CIDR) minus 2 (for the network and broadcast addresses).

Example: /27 → 2^(32 - 27) = 2^5 = 32 addresses. Minus 2 = 30 usable IPs.

Quick Examples

  • 192.168.1.0/24 → 192.168.1.1 to 192.168.1.254 usable
  • 10.0.0.0/8 → A massive range: 10.0.0.1 to 10.255.255.254
  • 192.168.1.128/25 → 128 IPs, starting halfway through the 192.168.1.0/24 block

Wrapping It Up

CIDR is how modern networks are defined. Once you understand that it simply refers to how many bits define your network vs host portion, the rest is just math. Whether you’re hand-writing configs in /etc/network/interfaces or building out a subnet plan, CIDR will be part of the conversation.

Triple "5" Farms – One slash at a time, we’re figuring it out.