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

Routing policy enforcement

Want to summarize with AI?

Log in

Explains how configuring inbound and outbound policies for eBGP neighbors prevents accidental route acceptance or advertisement and enhances security by enforcing routing policies.


Routing policy enforcement is a feature that

  • requires configuring inbound and outbound policies for external BGP (eBGP) neighbors

  • prevents accidental route acceptance or advertisement, and

  • provides an added security measure against configuration omission errors.

Routing policy enforcement behavior

If you do not configure a policy, BGP does not accept any routes from the neighbor, nor does it advertise any routes to it. This enforcement affects only eBGP neighbors, which are neighbors in a different autonomous system than this router. For internal BGP (iBGP) neighbors, which are neighbors in the same autonomous system, BGP accepts or advertises all routes if there is no policy.


Configure routing policy enforcement

Configure BGP routing filtering by applying a route policy.

This task outlines the steps to create and apply a route policy to filter BGP routes, ensuring that only desired routes are accepted or advertised.

Procedure

1.

Create a route policy and define its filtering logic.

Example:

Router# config
Router(config)# route-policy drop-as-1234
Router(config-rpl)# if as-path passes-through '1234' then
Router(config-rpl-if)# apply check-communities
Router(config-rpl-if)# else
Router(config-rpl-else)# pass
Router(config-rpl-else)# endif
Router(config-rpl)# end-policy
2.

Configures a neighbor IP address as a BGP peer and apply the route policy to inbound or outbound routes for the neighbor.

Example:

Router(config)# router bgp 120
Router(config-bgp)# neighbor 172.168.40.24
Router(config-bgp-nbr)# address-family ipv4 unicast
Router(config-bgp-nbr-af)# route-policy drop-as-1234 in
Router(config-bgp-nbr-af)# commit

BGP routes are filtered according to the defined route policy.