Overview & Thematic Scope
Route-maps combined with prefix-lists form the backbone of granular routing policy enforcement in BGP and OSPF environments. Whether you are filtering inbound advertisements from a service provider or redistributing connected networks into your core, understanding the interaction between match clauses, sequence numbers, and implicit deny logic is critical for preventing routing black holes. This FAQ addresses the most common configuration pitfalls and verification commands engineers encounter when deploying prefix filtering policies.

Frequently Asked Questions
- Q1: What is the correct command sequence to bind a prefix-list to a route-map for BGP filtering?
- You must first create the prefix-list, then reference it inside a route-map entry using the
match ip address prefix-listcommand, and finally apply the route-map to the BGP neighbor withroute-map NAME in|out. The prefix-list defines the network ranges, the route-map entry dictates the permit or deny action based on those matches, and the neighbor statement activates the policy directionally. For outbound filtering, always verify withshow ip bgp neighbors ADDRESS advertised-routesto confirm the policy is taking effect before clearing sessions . - Q2: Why does my route-map with a permit sequence still drop all routes?
- This almost always occurs because the route-map lacks a trailing permit statement or the prefix-list is empty. Route-maps have an implicit deny at the end—any route that does not explicitly match a permit sequence is discarded. If your prefix-list uses a
denyentry for a broad range but no subsequentpermitfor legitimate prefixes, the match will fail and fall through to the implicit deny. Always add a finalroute-map NAME permit 65535with no match clauses, or ensure your prefix-list has explicit permits for every intended prefix . - Q3: How do I filter prefixes based on prefix length rather than exact network address?
- Use the
geandlekeywords within theip prefix-listentry to define a range of mask lengths. For example,ip prefix-list FILTER permit 10.0.0.0/8 ge 16 le 24matches any subnet within 10.0.0.0/8 that has a mask length between /16 and /24 inclusive. This is far more scalable than enumerating individual prefixes, especially when filtering customer allocations or summarizing routes from a transit provider. The route-map simply references this prefix-list viamatch ip address prefix-list FILTER. - Q4: Can a single route-map sequence match multiple prefix-lists simultaneously?
- Yes, but the behavior depends on how the match clauses are structured. Multiple
match ip address prefix-listcommands within the same route-map sequence are evaluated with OR logic for that specific match type—if any one prefix-list matches, the condition is satisfied. However, if you combine different match types (such as prefix-list plus community), the logic shifts to AND. To implement OR logic across different attributes, use separate route-map sequences with the same action and reference them appropriately . - Q5: What is the difference between applying a route-map inbound versus outbound on a BGP neighbor?
- Inbound route-maps filter routes received from the neighbor before they enter the local BGP table, protecting your router from processing unwanted updates. Outbound route-maps filter routes advertised to the neighbor, controlling what they learn from you. Inbound filtering is generally preferred for resource protection, but outbound filtering is necessary when you need to enforce what a downstream peer receives regardless of your internal routing state. Note that modifying an inbound route-map triggers an automatic soft refresh of the neighbor session on modern platforms .
- Q6: How do I verify which prefixes are being denied by my route-map policy?
- Use the platform-specific prefix-list counters or route-map hit counters to identify denied traffic. On Cisco NX-OS,
show ip prefix-list NAMEdisplays match statistics per entry if hit counting is enabled. Additionally,show route-map NAMEreveals sequence-level match counts. For BGP-specific verification, compareshow ip bgp neighbors ADDR received-routes(requiressoft-reconfiguration inbound) againstshow ip bgpto see exactly which received prefixes were filtered by the inbound policy . - Q7: Can route-maps for prefix filtering be used with OSPF as well as BGP?
- Yes, but the application mechanism differs. For OSPF, you cannot apply a route-map directly to a neighbor. Instead, use
distribute-list route-map NAME inunder the OSPF process to filter routes during installation into the local routing table. This feature allows matching on additional attributes beyond prefix, including tag, route-type, and source router ID, providing granular control over which OSPF-learned routes are accepted . - Q8: What causes a route-map change to require a hard BGP reset on some platforms?
- Certain legacy platforms or specific policy changes—particularly those affecting outbound advertisements or altering the fundamental match structure—may require a hard reset if soft reconfiguration is not enabled. On modern NX-OS and IOS-XE releases, most route-map modifications trigger an automatic route refresh for inbound policies. To avoid hard resets entirely, enable
soft-reconfiguration inboundon critical neighbors before applying filters, or verify that your platform supports route-refresh capability with the peer .
Leave a comment