Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Prefix-List & Route-Map Reference

Direct answer

A prefix-list matches routes by prefix and prefix length. A route-map is an ordered list of permit and deny clauses that match routes — often with a prefix-list — and can set attributes on them. Both are read top-down, the first match wins, and both end with an implicit deny.

When to use this

Use it to control which routes are accepted, advertised or redistributed, to set attributes on some of them, or when routes disappear after a policy was applied.

First 30 seconds

1. show ip prefix-list NAME and show route-map NAME — entries and hit counts.

2. Prefix-lists match prefix + length (le/ge); route-maps end with an implicit deny.

3. Apply with neighbor X route-map NAME in|out, then clear ip bgp X soft in|out.

Operational verification

route → route-map clauses in sequence order → first clause whose match is true → permit: apply set, accept · deny: drop → no clause matches: implicit deny → soft clear → result visible in the BGP table

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
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.

PlatformCisco IOS / IOS XE · Cisco IOS XE
Key commandshow ip prefix-list
Scope / prerequisiteUse it to control which routes are accepted, advertised or redistributed, to set attributes on some of them, or when ro…
Show · 1
What next?3 suggested next steps
Catalog command links1
Evidence0
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

Operational workflow

Verification & Troubleshooting

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

3 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 Operational verification and known-good state Verify boundary
show ip prefix-list detail CUST
show route-map TO-ISP
show ip bgp neighbors 192.0.2.2 advertised-routes
show ip bgp neighbors 192.0.2.2 routes

The prefix-list detail shows each entry with a hit count. show route-map shows every clause with its match and set lines and the number of matches. The last two show the result: what is sent to the neighbour after outbound policy, and what was accepted after inbound policy.

Known-good: the counters rise on the entries that are meant to match, and the advertised or accepted routes are exactly the intended set.

Step 2 Failure signatures and troubleshooting branches Narrow the fault
  • All routes disappeared after applying a route map. No final permit clause; unmatched routes are dropped.
  • Subnets are not matched. The prefix-list entry has no le/ge, so it matches only the exact prefix.
  • Too much is matched. le 32 on a broad entry lets every more-specific through.
  • A clause never matches. An earlier clause catches the route first; sequence order decides.
  • The route map refers to a list that does not exist. A missing list can match everything or nothing depending on the feature; check the name's spelling and case.
  • The policy was changed but the routes were not. BGP applies it to new updates only; run clear ip bgp <neighbor> soft in or soft out.
  • Applied in the wrong direction. in filters what is received, out what is sent.
Step 3 When the problem is really fixed Narrow the fault
  • The intended routes, and only those, are advertised or accepted.
  • Hit counters increase on the intended entries.
  • Every route map has a deliberate final clause.
  • Attributes set by the route map are visible on the routes.
Command lookup Jump straight to Cisco syntax
Key points

10.0.0.0/8 in a prefix-list matches only that exact /8; add le 24 or ge 24 to match longer prefixes inside it. 0.0.0.0/0 is only the default route; 0.0.0.0/0 le 32 is everything. In a route-map, a route that matches no clause is dropped, so finish with an empty permit clause if the rest should pass. A clause without match matches all routes. Policy changes apply after a soft clear.

Key checks

show ip prefix-list detail <name> → entries and hit counts. show route-map <name> → clauses in order with match and set lines. show ip bgp neighbors <ip> routes → what survived inbound policy. Then clear ip bgp <ip> soft in (or out).

ReferenceWhat it is1 section · depth on demand

Mechanics & mental model

A prefix list matches routes by network and prefix length. A route map is an ordered list of clauses that match routes — often using a prefix list — and either drop them, pass them, or pass them with changed attributes. Together they are the standard tools for filtering and adjusting routes in BGP and in redistribution.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

Nearly all routing policy on Cisco routers is written with these two objects, and both end in an implicit deny. One wrong length operator or one missing final clause filters more than intended, without any error message.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Prefix lists and route maps

Prefix lists match routes by network and prefix length, and route maps combine those matches with actions. Together they form most BGP and redistribution policy. Cisco's IOS XE prefix-list data model describes the matching:

  • Each entry has a sequence number, permit or deny, a prefix, and optional ge and le values.
  • ge sets the minimum prefix length that matches, and le the maximum.
  • For example, 10.0.0.0/8 ge 24 le 32 matches any prefix inside 10.0.0.0/8 with a length from /24 to /32.
  • A prefix without ge or le matches only that exact prefix and length.

Prefix-list matching examples

EntryMatchesDoesn't match
permit 10.20.0.0/16Only 10.20.0.0/1610.20.30.0/24
permit 10.20.0.0/16 le 2410.20.0.0/16 up to /24 inside it10.20.30.0/25
permit 10.20.0.0/16 ge 24/24 to /32 inside 10.20.0.0/1610.20.0.0/16 itself
permit 0.0.0.0/0Only the default routeEverything else
permit 0.0.0.0/0 le 32Every IPv4 prefix—
deny 0.0.0.0/0 ge 25Any prefix longer than /24 (with a later permit)/24 and shorter

Route-map logic

ElementBehaviour
SequencesEvaluated in order; the first matching sequence applies
permit sequenceMatching routes are accepted, then any set statements apply
deny sequenceMatching routes are rejected
Several match lines in one sequenceAll must match (AND)
Several values in one match lineAny can match (OR)
No match in any sequenceAn implicit deny at the end
R1(config)# ip prefix-list CUSTOMER-A seq 10 permit 192.0.2.0/24
R1(config)# ip prefix-list CUSTOMER-A seq 20 permit 198.51.100.0/22 le 24
R1(config)# ip prefix-list NO-LONG seq 10 deny 0.0.0.0/0 ge 25
R1(config)# ip prefix-list NO-LONG seq 20 permit 0.0.0.0/0 le 24
R1(config)# route-map FROM-CUSTOMER-A permit 10
R1(config-route-map)# match ip address prefix-list CUSTOMER-A
R1(config-route-map)# set local-preference 150
R1(config-route-map)# set community 65010:100 additive
R1(config)# route-map FROM-CUSTOMER-A deny 100
R1# show ip prefix-list CUSTOMER-A
R1# show route-map FROM-CUSTOMER-A | include route-map|Match|Policy routing matches
R1# show bgp ipv4 unicast prefix-list CUSTOMER-A

Testing before applying

show bgp ipv4 unicast prefix-list <name> lists which routes in the current table the prefix list matches. It shows the effect of a new filter before it's attached to a neighbour. The explicit deny 100 at the end documents the implicit deny for whoever reads the configuration next.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Mechanics and state ownership

Prefix lists. An entry such as ip prefix-list CUST permit 10.20.0.0/16 matches exactly that /16 and nothing else. ge and le widen the match to a range of prefix lengths within the block: 10.20.0.0/16 le 24 matches the /16 and every subnet of it up to /24; 10.20.0.0/16 ge 24 le 24 matches only its /24s. The first number says which bits must match; ge/le say how long the route's own prefix may be. 0.0.0.0/0 matches only the default route; 0.0.0.0/0 le 32 matches everything. Entries are checked in sequence order, the first match decides, and anything unmatched is denied.

Route maps. Each clause has a sequence number, an action (permit or deny), optional match lines and optional set lines. A route is tested against the clauses in order. In the first clause whose match lines all fit, a permit passes the route and applies the set lines; a deny drops it. A clause with no match line matches every route. A route that matches no clause is dropped.

Two things are easy to mix up. A deny entry in a prefix list used inside a route map does not drop the route; it only means "this clause does not match", and the route goes on to the next clause. And a route map that sets an attribute for a few routes needs a final empty permit clause, or all other routes are filtered out.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

Cisco IOS / IOS XE RFC 4271Accept only a customer's prefixes and prefer them

Assumptions: Lab addressing; local AS 65000; loopbacks carried in the IGP.

ip prefix-list CUSTOMER seq 10 permit 203.0.113.0/24
ip prefix-list CUSTOMER seq 20 permit 198.51.100.0/22 le 24
!
route-map FROM-CUSTOMER permit 10
 match ip address prefix-list CUSTOMER
 set local-preference 200
! everything else is dropped by the implicit deny
!
router bgp 65000
 address-family ipv4 unicast
  neighbor 192.0.2.2 route-map FROM-CUSTOMER in
!
! then: clear ip bgp 192.0.2.2 soft in

Expected output

Cisco IOS / IOS XE RFC 4271show route-map FROM-CUSTOMER

Expected state: Clauses listed in sequence order with their match and set lines.

route-map FROM-CUSTOMER, permit, sequence 10
  Match clauses:
    ip address prefix-lists: CUSTOMER
  Set clauses:
    local-preference 200
  Policy routing matches: 0 packets, 0 bytes
! Illustrative output, not captured Evidence.
One permit clause: routes matching prefix-list CUSTOMER get LOCAL_PREF 200. There is no further clause, so every other route from this neighbour is denied. The `Policy routing matches` counter is for policy-based routing and stays 0 when the route-map is used for BGP.
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 docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → Prefix-List & Route-Map Reference. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
prefix listroute maproute-mapge lerouting policyBGP route mapBGP route policy
Embedded reference data

Quick lookup tables

Prefix-List & Route-Map Reference operational reference

Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.

BoundaryKnown-good for Prefix-List & Route-Map ReferenceSuspicious signatureNext proof
Input/sessionCorrect peer, source, AF and route contextSession/source/input state disagreesExact peer/source/prefix detail
Policy/protocoldeterministic route policy built from ordered prefix-list matching and route-map sequence evaluation, with explicit direction, match/set behavior, implicit deny boundaries and before/after route evidence matches intended designa prefix-list length operator matches a different set than intended, an earlier sequence shadows the expected rule, no sequence permits the route, the route map is attached in the wrong direction, a set action never runs because its match failed, or operators inspect only the policy configuration without proving the exact prefix traversed itCompare policy/attributes/propagation
Route/forwardingExpected result reaches RIB/FIBControl-plane state exists but installed path disagreesRIB/FIB/CEF + next-hop proof
ClosureOriginal workload passes for explained reasonSymptom moved, was bypassed or state was forcedRegression/failover test
Embedded quick reference

Operational notes

Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.

Prefix-List & Route-Map Fast Check

Policy order and match verification.

Prefix list:

show ip prefix-list

Remember: ge/le constrain prefix length.

Route map:

show route-map

Read sequences in order.

Check match counters.

Then verify effect in BGP/OSPF/redistribution/PBR.

An implicit deny is often the hidden boundary.

Confirmation

Confirm action

Continue?