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

PDF

VRF next hop route policies

Want to summarize with AI?

Log in

Overview

Outlines VRF next hop route policies, providing instructions for configuring VRF-specific next hop policies to manage routing decisions within VRF environments.

A VRF next hop route policy is a routing control mechanism that

  • enables you to configure route policies at the BGP next-hop attach point for individual VRF instances,

  • limits notifications delivered to BGP for specific prefixes, and

  • provides precise traffic engineering and security compliance for each VRF.

Table 1. Feature History Table

Feature Name

Release Name

Description

Virtual Routing Forwarding Next Hop Routing Policy Release 7.11.1

You can now enable a route policy at the BGP next-hop attach point to limit notifications delivered to BGP for specific prefixes, which equips you with better control over routing decisions, and allows for precise traffic engineering and security compliance for each VRF instance, and helps establish redundant paths specific to each VRF.

The feature introduces these changes:

CLI:

Modified Command:

YANG Data Model

  • New XPaths for

    Cisco-IOS-XR-ipv4-bgp-cfg.yang

  • Cisco-IOS-XR-um-router-bgp-cfg

(see GitHub, YANG Data Models Navigator)

VRF next hop route policies give network administrators fine-grained control over route advertisement and notification within BGP processes. By assigning route policies to specific VRF address families, you can tailor routing behavior, enhance security, and ensure preferred routing paths for different tenants or services on your network.


Configure a VRF next hop policy

Enable and apply a next hop route policy to a VRF table. This allows you to control which routes are advertised to BGP peers based on prefix and protocol.

Use this task to ensure BGP only learns or advertises specific routes within a VRF.

Before you begin

Decide on the prefixes and protocols you want the route policy to match.

Procedure

1.

Define a route policy to match desired prefixes and protocols.

Example:


Router(config)# route-policy nh-route-policy
Router(config-rpl)# if destination in (10.1.1.0/24) and protocol in (connected, static) then
Router(config-rpl-if)# drop
Router(config-rpl-if)# endif
Router(config-rpl)# end-policy
Router(config-rpl)# exit
2.

Enter BGP configuration mode, and apply the next hop route policy to the VRF address family.

Example:

Router(config)# router bgp 500
Router(config-bgp)# vrf vrf10 
Router(config-bgp-vrf)# address-family ipv4 unicast
Router(config-bgp-vrf-af)# nexthop route-policy nh-route-policy

3.

Use the show bgp vrf vrf_name ipv4 unicast command to verify if the policy is applied.

Example:

Router# show bgp vrf vrf1 ipv4 unicast 
Fri Jul  7 15:51:16.309 +0530
BGP VRF vrf1, state: Active
BGP Route Distinguisher: 1:1
VRF ID: 0x6000000b
BGP router identifier 10.1.1.1, local AS number 65001
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe000000b   RD version: 1356
BGP table nexthop route policy: nh-route-policy --> This is the same route policy that was configured.
BGP main routing table version 1362
BGP NSR Initial initsync version 1355 (Reached)
BGP NSR/ISSU Sync-Group versions 1362/0

Status codes: s suppressed, d damped, h history, * valid, > best
              i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
 Network           Next Hop      Metric  LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf vrf1)
Route Distinguisher Version: 1356
*> 10.1.1.0/24      0.0.0.0       0       32768  ?
*> 192.0.2.0/24     10.1.1.1      0       32768  ?