CCNP-Studies
Routing
4-BGP
18 Prefix Lists and Route Maps in Bgp

BGP Filtering Options and Best Practices

Introduction to BGP Filtering

  • Filtering in BGP (Border Gateway Protocol) is crucial for controlling the flow of routing information and ensuring efficient routing within and between autonomous systems. It helps network administrators manage and optimize BGP route propagation.

Filtering Options

Distribute List

  • Usage: Distribute Lists in BGP utilize standard or extended access control lists (ACLs) for route filtering.
  • Best Practice: While Distribute Lists can be used, Cisco's best practice often leans towards Prefix Lists for simplicity and flexibility.

Filter List

  • Usage: Filter Lists rely on AS-PATH ACLs for route filtering.
  • Best Practice: Filter Lists can be useful in certain scenarios, but Prefix Lists are often preferred due to their simplicity and enhanced performance.

Prefix Lists

  • Usage: Prefix Lists are primarily used for route filtering, not packet filtering. They provide easier, more efficient, and flexible route filtering options compared to access lists (ACLs).
  • Best Practice: Cisco's best practice emphasizes the use of Prefix Lists due to their speed and straightforward CLI syntax. They are particularly suitable for BGP route filtering.
  • Keywords: Prefix Lists offer keywords like 'ge' (greater than or equal to) and 'le' (less than or equal to) for fine-grained control.
  • Examples: Below are some examples of Prefix Lists:
    • ip prefix-list PL permit 192.168.10.0/24 le 28
    • ip prefix-list PL permit 10.0.0.0/8 le 16
    • ip prefix-list PL permit 172.16.0.0/16 ge 24
    • ip prefix-list PL permit 192.168.0.0/24 ge 27 le 28
    • ip prefix-list PL permit 0.0.0.0/0 le 32
    • ip prefix-list PL permit 0.0.0.0/0
  • Implicit "Deny All": Prefix Lists include an implicit "deny all" rule at the end of each list.

Route Maps

  • Usage: Route Maps are more complex ACLs that are used for testing and matching specific conditions. They can also modify the Path Attribute (PA) of Network Layer Reachability Information (NLRI).
  • Best Practice: Route Maps are typically employed in scenarios where more advanced filtering or policy-based routing is needed. For basic route filtering, Prefix Lists are often a better choice.
  • Implicit "Deny All": Similar to Prefix Lists, Route Maps also have an implicit "deny all" rule at the end of each map.

Verification and Validation Commands

Prefix Lists

  • Display Prefix Lists: Use the following commands to display Prefix Lists:
    • show ip prefix-list
    • show ip prefix-list [detail | summary]
    • show ip prefix-list [pl-name] [net/length] first-match
  • Clear Prefix List: To clear Prefix List counters, use the command:
    • clear ip prefix-list [pl-name]

Route Maps

  • Display Route Maps: You can view Route Maps with the following command:
    • show route-map [rm-name]
  • Clear Route Map Counters: To clear Route Map counters, use the command:
    • clear route-map counters rm-name

Conclusion

Filtering BGP routes is essential for maintaining a well-organized and optimized network. While Distribute Lists and Filter Lists have their uses, Prefix Lists are often the preferred choice due to their simplicity, speed, and efficiency. Route Maps, on the other hand, are valuable for advanced route filtering and policy-based routing scenarios.