Pcornel
Networking · Routing › BGP › BGP Communities Deep Reference

Prefix-List & Route-Map Reference

Cheat sheet · https://pcornel.dk/topic.php?topic=216

Back to the Topic

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.

Remember

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.

First 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).

Commands

show ip prefix-list
Shows IPv4 prefix-list entries and counters.
show bgp ipv4 unicast prefix-list <name>
ip prefix-list CUST permit 10.20.0.0/16
show route-map
clear ip bgp <neighbor> soft in

Verify in this order

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

Where it usually breaks

physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result

Prefix-List & Route-Map Reference operational reference

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

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=216

Confirmation

Confirm action

Continue?