Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Prefix · Addressing

Direct answer

The prefix (prefix length) is the number of leading bits that identify the network, written /n; a /26 has 26 network bits and 64 addresses.

When to use this

Use it when reading or writing addresses in slash notation, or comparing route specificity.

First 30 seconds

1. The prefix length defines the network part of an address.

2. Must match on all devices in a subnet.

3. Mismatched masks break ARP and routing.

4. Longer prefix = smaller network.

5. Check both ends of links.

Operational verification

address + prefix → network ID → connected route

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
Scope / prerequisiteUse it when reading or writing addresses in slash notation, or comparing route specificity.
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.

1 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 Common mistakes Narrow the fault
  • Mixing up prefix length and wildcard mask in ACLs and OSPF network statements.
  • Assuming /24 because the address looks like an old class C.
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 interface brief — interface addresses
  • show ip interface <interface> — Internet address with /len
ReferenceWhat it is1 section · depth on demand

Reading prefix lengths

The prefix length counts the network bits. Each extra bit halves the subnet:

PrefixHost bitsAddresses
/161665 536
/20124 096
/248256
/28416
/3201 (host route)

Routers use the longest matching prefix: a packet to 10.1.1.5 matches 10.1.1.0/24 before 10.0.0.0/8 and before 0.0.0.0/0.

ReferenceWhy it matters1 section · depth on demand

How it works

The prefix length (/24) is the number of leading 1-bits in the subnet mask. Every extra bit halves the block: /24 = 256 addresses, /25 = 128, /26 = 64, /27 = 32, /28 = 16. Routers compare prefix lengths for longest-match routing, so the same address can match several routes of different lengths.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

One block, written the way each IOS command expects

Block: 10.1.4.0/22 (10.1.4.0 – 10.1.7.255)

ContextSyntax
Interface addressip address 10.1.4.1 255.255.252.0
Static routeip route 10.1.4.0 255.255.252.0 192.0.2.1
Prefix listip prefix-list SITE permit 10.1.4.0/22
Prefix list incl. subnetsip prefix-list SITE permit 10.1.4.0/22 le 24
ACL (wildcard)permit ip 10.1.4.0 0.0.3.255 any
OSPF network statementnetwork 10.1.4.0 0.0.3.255 area 0
BGPnetwork 10.1.4.0 mask 255.255.252.0
IPv6 equivalent ideaipv6 route 2001:db8:4::/48 2001:db8::1

Wildcard = 255.255.255.255 − mask, octet by octet (255 − 252 = 3).

Prefix-list length matching

EntryMatches
10.1.4.0/22Exactly /22
10.1.4.0/22 le 24/22, /23 and /24 inside the block
10.1.4.0/22 ge 24 le 24Only the /24s inside the block
0.0.0.0/0 le 32Everything
0.0.0.0/0Only the default route

Prefix length and route preference

A longer prefix is more specific and wins the forwarding lookup regardless of protocol (RFC 4632 aggregation relies on this). Every additional bit halves the block, so /22 → /23 splits it into two halves.

Checks

  • show ip route 10.1.4.0 255.255.252.0 longer-prefixes lists the components under the /22.
  • show ip prefix-list SITE shows hit counts per entry — useful to confirm the le/ge logic.
  • IOS rejects a static route whose address has host bits set for the given mask (%Inconsistent address and mask), which catches many prefix mistakes.
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

PrefixMaskWildcardHosts
/8255.0.0.00.255.255.25516 777 214
/16255.255.0.00.0.255.25565 534
/22255.255.252.00.0.3.2551 022
/23255.255.254.00.0.1.255510
/24255.255.255.00.0.0.255254
/30255.255.255.2520.0.0.32
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 → Prefix. 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?