Skip to main content

BGP Routing Policy

·400 words·2 mins
lab1918
Author
lab1918

In BGP (Border Gateway Protocol), route maps, filter lists, and prefix lists are essential tools for implementing routing policies. These tools allow network administrators to control route advertisement, route selection, and path manipulation based on a set of defined criteria.

Route Maps
#

Route maps in BGP are used to control and modify routing information and to implement policy-based routing decisions. They are extremely versatile and can be used for a variety of purposes:

  • Route Filtering: Selectively advertise or suppress specific routes.
  • Path Attribute Modifications: Change attributes like AS path, community, local preference, MED, etc.
  • Conditional Routing: Apply different policies based on certain conditions (like matching IP prefixes or BGP communities).

Example of a Route Map Configuration:

route-map SET-LOCAL-PREF permit 10
 match ip address prefix-list PREFIX-LIST-1
 set local-preference 200

This example sets the local preference to 200 for routes matching the prefix list PREFIX-LIST-1.

Filter Lists
#

Filter lists in BGP are used to permit or deny routes based on AS paths. They are simpler than route maps but are specifically designed for filtering routes by analyzing their AS path attributes.

  • AS Path Filtering: Control route advertisement based on the AS path attribute.
  • Simplifies Management: Easier to manage and understand compared to complex route maps for AS path filtering.

Example of a Filter List:

ip as-path access-list 1 permit ^123$
neighbor 192.0.2.1 filter-list 1 in

This example permits only routes originating from AS 123.

Prefix Lists
#

Prefix lists are used to match on IP prefixes. They are more flexible and efficient compared to traditional access lists for matching IP addresses and subnet masks.

  • IP Prefix Matching: Used for matching specific IP prefixes and their lengths.
  • Granular Control: Allows for precise control over which prefixes are advertised or accepted.

Example of a Prefix List:

ip prefix-list PREFIX-LIST-1 seq 5 permit 192.0.2.0/24

This example permits routes for the 192.0.2.0/24 network.

Combined Use in BGP
#

These tools are often used in combination to implement comprehensive BGP policies. For example, a route map could reference a prefix list to match specific routes and then set BGP attributes accordingly. Similarly, filter lists can be used within route maps to control route advertisement based on AS paths.

The use of route maps, filter lists, and prefix lists provides network administrators with powerful and flexible methods to influence BGP routing in their networks, ensuring that routing decisions align with the organization’s network policies and objectives.