Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

CIDR

Direct answer

Classless Inter-Domain Routing (CIDR) writes the network part as a prefix length (/24 instead of 255.255.255.0) and allows any prefix size, which enables subnetting and route summarisation.

When to use this

Use it when allocating or summarising address blocks without classful boundaries.

First 30 seconds

1. CIDR uses prefix length instead of classes.

2. Enables summarisation and right-sized subnets.

3. Longest prefix match selects routes.

4. Plan blocks to summarise.

5. Avoid overlap.

Operational verification

address + prefix length → network → routing longest match

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard
Key commandshow ip route 172.16.4.0 255.255.252.0 longer-prefixes
Scope / prerequisiteUse it when allocating or summarising address blocks without classful boundaries.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Checking summaries Verify boundary
show ip route 172.16.4.0 255.255.252.0 longer-prefixes
show ip bgp 172.16.4.0/22

Verify that every component of a summary is reachable behind the summarising router; otherwise traffic for missing subnets is dropped at the Null0 discard route.

Step 2 Common mistakes Narrow the fault
  • Summarising a range that is not on a bit boundary (e.g. 10.0.1.0–10.0.4.0 is not one /22).
  • Advertising a summary that covers networks you do not own.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points
  • Prefix length and mask describe the same boundary
  • Network and directed-broadcast addresses are not ordinary host addresses
  • Hosts per traditional subnet are 2^(host bits)-2, with point-to-point exceptions
  • VLSM allocates largest requirements first and must avoid overlap.
Key checks
  • show ip route — prefixes with lengths
  • show ip route <prefix> longer-prefixes — covered routes
ReferenceWhat it is1 section · depth on demand

Why CIDR matters

Before CIDR, address size was fixed by class (A /8, B /16, C /24). CIDR allows any prefix length, which enables:

  • Subnetting: splitting a block into smaller subnets.
  • Summarisation (supernetting): advertising 10.1.0.0/22 instead of four /24s, which shrinks routing tables and hides flapping subnets.

To summarise, find the common leading bits: 172.16.4.0/24–172.16.7.0/24 share 22 bits, so the summary is 172.16.4.0/22. A summary must not cover subnets that live elsewhere, or traffic is black-holed.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Testing whether a range can be one prefix

A set of networks can be summarised exactly by one prefix when:

1. The number of blocks is a power of two (2, 4, 8 …), and

2. The first block starts on a multiple of that count.

RangeBlocksFirst block ÷ countOne prefix?
172.16.4.0 – 172.16.7.0 (/24s)44 ÷ 4 = 1yes → 172.16.4.0/22
10.0.1.0 – 10.0.4.0 (/24s)41 ÷ 4 = 0.25no
10.0.8.0 – 10.0.15.0 (/24s)88 ÷ 8 = 1yes → 10.0.8.0/21
192.168.10.0 – 192.168.12.03—no (3 is not a power of two)

Smallest covering prefix (may include extra space)

Write the first and last network in binary and count common leading bits:

10.0.1.0 = 00001010.00000000.00000001.00000000
10.0.4.0 = 00001010.00000000.00000100.00000000
common   = 00001010.00000000.00000 → 21 bits → 10.0.0.0/21

10.0.0.0/21 covers 10.0.0.0 – 10.0.7.255: it includes 10.0.0.0/24 and 10.0.5.0 – 10.0.7.0 that are not part of the range. Advertising it attracts traffic for those addresses — fine only if they are unused and the router has a discard route.

CIDR on the internet (RFC 4632)

Aggregation keeps global routing tables small: a provider announces its allocation as one prefix instead of every customer network. More-specific announcements still win by longest match, which is used for traffic engineering — and abused in prefix hijacks. Filtering accepted prefix lengths (commonly nothing longer than /24 for IPv4) is standard practice.

Verify a summary on IOS

CommandPurpose
show ip route 10.0.8.0 255.255.248.0 longer-prefixesComponents really present behind the summary
show ip bgp 10.0.8.0/21Aggregate attributes in BGP
show ip route 10.0.8.0 255.255.248.0Local Null0 discard route for the summary
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Worked example

CIDR (Classless Inter-Domain Routing) removed the old fixed class A/B/C boundaries. Any prefix length can be used, so address blocks fit actual needs and contiguous networks can be advertised as one shorter prefix. Summarisation is what keeps routing tables small and limits how far a change propagates, but it only works cleanly when address plans are hierarchical: networks that belong together must also sit together numerically. The worked example shows how to find the common bits, and why a summary that is too wide can attract traffic for networks that do not exist.

CIDR replaced classful addressing: any prefix length, so routes can be aggregated (supernetting) and address space allocated efficiently.

Worked example — summarise 10.1.0.0/24 through 10.1.3.0/24: the first 22 bits are common (third octet 0–3 = 000000xx) → 10.1.0.0/22. Summarising 10.1.0.0/24–10.1.4.0/24 needs a /21 (10.1.0.0–10.1.7.255), which also covers unused space — a black-hole risk without a discard route.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 791

Authoritative/upstream documentation reviewed for bounded claims in IP Fundamentals → IPv4 → Addressing → CIDR. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc791.html · confidence 94%
Confirmation

Confirm action

Continue?