Use it when allocating or summarising address blocks without classful boundaries.
CIDR
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.
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.
address + prefix length → network → routing longest match
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show ip route 172.16.4.0 255.255.252.0 longer-prefixesVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 · 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.
- 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.
show ip route— prefixes with lengthsshow 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.
| Range | Blocks | First block ÷ count | One prefix? |
|---|---|---|---|
| 172.16.4.0 – 172.16.7.0 (/24s) | 4 | 4 ÷ 4 = 1 | yes → 172.16.4.0/22 |
| 10.0.1.0 – 10.0.4.0 (/24s) | 4 | 1 ÷ 4 = 0.25 | no |
| 10.0.8.0 – 10.0.15.0 (/24s) | 8 | 8 ÷ 8 = 1 | yes → 10.0.8.0/21 |
| 192.168.10.0 – 192.168.12.0 | 3 | — | 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
| Command | Purpose |
|---|---|
show ip route 10.0.8.0 255.255.248.0 longer-prefixes | Components really present behind the summary |
show ip bgp 10.0.8.0/21 | Aggregate attributes in BGP |
show ip route 10.0.8.0 255.255.248.0 | Local Null0 discard route for the summary |
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.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%