Troubleshooting Route-Maps for Prefix Filtering: Configuration, Compatibility & Error Resolving

Troubleshooting Route-Maps for Prefix Filtering: Configuration, Compatibility & Error Resolving

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.

Troubleshooting Route-Maps for Prefix Filtering: Configuration, Compatibility & Error Resolving details

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-list command, and finally apply the route-map to the BGP neighbor with route-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 with show ip bgp neighbors ADDRESS advertised-routes to 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 deny entry for a broad range but no subsequent permit for legitimate prefixes, the match will fail and fall through to the implicit deny. Always add a final route-map NAME permit 65535 with 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 ge and le keywords within the ip prefix-list entry to define a range of mask lengths. For example, ip prefix-list FILTER permit 10.0.0.0/8 ge 16 le 24 matches 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 via match 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-list commands 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 NAME displays match statistics per entry if hit counting is enabled. Additionally, show route-map NAME reveals sequence-level match counts. For BGP-specific verification, compare show ip bgp neighbors ADDR received-routes (requires soft-reconfiguration inbound) against show ip bgp to 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 in under 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 inbound on critical neighbors before applying filters, or verify that your platform supports route-refresh capability with the peer .