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.
Prefix-List & Route-Map Reference
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.
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.
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
Operational reference
Fast context before you go deeper.
show ip prefix-listShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
Verification & 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 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
permitclause; 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 32on 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 inorsoft out. - Applied in the wrong direction.
infilters what is received,outwhat 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.
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.
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
geandlevalues. gesets the minimum prefix length that matches, andlethe maximum.- For example,
10.0.0.0/8 ge 24 le 32matches any prefix inside 10.0.0.0/8 with a length from /24 to /32. - A prefix without
georlematches only that exact prefix and length.
Prefix-list matching examples
| Entry | Matches | Doesn't match |
|---|---|---|
permit 10.20.0.0/16 | Only 10.20.0.0/16 | 10.20.30.0/24 |
permit 10.20.0.0/16 le 24 | 10.20.0.0/16 up to /24 inside it | 10.20.30.0/25 |
permit 10.20.0.0/16 ge 24 | /24 to /32 inside 10.20.0.0/16 | 10.20.0.0/16 itself |
permit 0.0.0.0/0 | Only the default route | Everything else |
permit 0.0.0.0/0 le 32 | Every IPv4 prefix | — |
deny 0.0.0.0/0 ge 25 | Any prefix longer than /24 (with a later permit) | /24 and shorter |
Route-map logic
| Element | Behaviour |
|---|---|
| Sequences | Evaluated in order; the first matching sequence applies |
permit sequence | Matching routes are accepted, then any set statements apply |
deny sequence | Matching routes are rejected |
Several match lines in one sequence | All must match (AND) |
Several values in one match line | Any can match (OR) |
| No match in any sequence | An 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.
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
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
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 inExpected output
show route-map FROM-CUSTOMERExpected 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.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 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%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.
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.
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.
| Boundary | Known-good for Prefix-List & Route-Map Reference | Suspicious signature | Next proof |
|---|---|---|---|
| Input/session | Correct peer, source, AF and route context | Session/source/input state disagrees | Exact peer/source/prefix detail |
| Policy/protocol | deterministic 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 design | a 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 it | Compare policy/attributes/propagation |
| Route/forwarding | Expected result reaches RIB/FIB | Control-plane state exists but installed path disagrees | RIB/FIB/CEF + next-hop proof |
| Closure | Original workload passes for explained reason | Symptom moved, was bypassed or state was forced | Regression/failover test |
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.