BGP Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases

PDF

BGP Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases

BGP attribute filters

Want to summarize with AI?

Log in

Describes filtering BGP routes based on attributes to control route acceptance and advertisement.


BGP attribute filter is a feature that

  • checks the integrity of BGP updates in BGP update messages

  • optimizes reactions when detecting invalid attributes, and

  • filters attributes received in the incoming update message.

Purpose and operation of the attribute filter

The BGP attribute filter feature checks the integrity of BGP updates in BGP update messages. It also optimizes reactions when it detects invalid attributes. BGP update messages contain a list of mandatory and optional attributes. These attributes include MED, LOCAL_PREF, and COMMUNITY, and so on. In some cases, if attributes are malformed, filtering them at the receiving router is necessary. The BGP attribute filter regulates which attributes are accepted in incoming update messages. The attribute filter can also filter any attributes that may potentially cause undesirable behavior on the receiving router.

Some BGP updates are malformed due to incorrect formatting of attributes, such as the Network Layer Reachability Information (NLRI) or other fields in the update message. These malformed updates, when received, cause undesirable behavior on the receiving routers. Such undesirable behavior may occur during update message parsing or during re-advertisement of received NLRIs. In such scenarios, it's better to filter these corrupted attributes at the receiving end.


Configure BGP attribute filtering

To filter malformed BGP attributes received in incoming update messages.

You perform this task to prevent undesirable behavior on receiving routers caused by malformed BGP attributes.

Procedure

1.

Enter global configuration mode and specify the autonomous system number to enter BGP configuration mode.

Example:

Router# configure
Router(config)# router bgp 100
2.

Run the attribute-filter command with the attribute-filter group name to enter the attribute-filter group configuration mode.

Example:

Router(config-bgp)# attribute-filter group ag_discard_med
3.

Specify a single or a range of attribute codes and an associated action.

Example:

Router(config-bgp-attrfg)# attribute 24 discard

The allowed actions are:

  • Treat-as-withdraw: The system considers the update message for withdrawal. The associated IPv4-unicast or MP_REACH NLRIs, if present, are withdrawn from the neighbor's Adj-RIB-In.

  • Discard attribute: The system discards this attribute. The matching attributes alone are discarded, and the rest of the update message is processed normally.