iBGP inside VRF configuration on a Cisco Nexus switch

Due to a more complex network topology (because of the desire to save money) I recently had to implement iBGP routing inside a VRF on a cluster of Cisco Nexus switches.

Configuring iBGP (Internal Border Gateway Protocol) within a VRF (Virtual Routing and Forwarding) instance on a Cisco Nexus switch involves several steps. Below is a step-by-step guide to help you set it up:

Step 1: Create the VRF

First, you need to create a VRF instance on your Nexus switch.

bash

Nexus(config)# vrf context VRF_NAME
Nexus(config-vrf)# rd 100:1
Nexus(config-vrf)# address-family ipv4 unicast
Nexus(config-vrf-af)# exit
Nexus(config-vrf)# address-family ipv6 unicast
Nexus(config-vrf-af)# exit
Nexus(config-vrf)# exit

Replace VRF_NAME with the name you want to assign to your VRF instance. The rd (route distinguisher) is a unique identifier for the VRF.

Step 2: Assign Interfaces to the VRF

Assign the relevant interfaces to the newly created VRF.

bash

Nexus(config)# interface Ethernet1/1
Nexus(config-if)# vrf member VRF_NAME
Nexus(config-if)# ip address x.x.x.x/xx
Nexus(config-if)# exit

Repeat this for each interface that should be part of the VRF.

Step 3: Configure the iBGP Peering

Configure the iBGP session within the VRF context.

bash

Nexus(config)# router bgp 65001
Nexus(config-router)# vrf VRF_NAME
Nexus(config-router-vrf)# address-family ipv4 unicast
Nexus(config-router-vrf-af)# neighbor PEER_IP remote-as 65001
Nexus(config-router-vrf-af)# neighbor PEER_IP update-source Loopback0
Nexus(config-router-vrf-af)# neighbor PEER_IP activate
Nexus(config-router-vrf-af)# exit
Nexus(config-router-vrf)# address-family ipv6 unicast
Nexus(config-router-vrf-af)# neighbor PEER_IP remote-as 65001
Nexus(config-router-vrf-af)# neighbor PEER_IP update-source Loopback0
Nexus(config-router-vrf-af)# neighbor PEER_IP activate
Nexus(config-router-vrf-af)# exit
Nexus(config-router-vrf)# exit
Nexus(config-router)# exit
  • 65001 is the AS number used for iBGP.
  • PEER_IP is the IP address of the iBGP peer within the VRF.
  • Loopback0 is typically used as the update source, assuming your loopback interface is part of the VRF.

Step 4: Verify the Configuration

Verify the iBGP peering status and the VRF routes.

bash

Nexus# show bgp vrf VRF_NAME all summary
Nexus# show ip route vrf VRF_NAME

These commands will display the status of BGP neighbors and the routing table within the VRF.

Step 5: Troubleshooting

If you encounter issues, use the following commands to troubleshoot:

bash

Nexus# show bgp vrf VRF_NAME all neighbors
Nexus# show bgp vrf VRF_NAME all
Nexus# show ip bgp vpnv4 vrf VRF_NAME
Nexus# show ip bgp vpnv6 vrf VRF_NAME

These commands provide detailed information about BGP sessions and routes within the VRF context.

By following these steps, you should be able to successfully configure iBGP within a VRF on a Cisco Nexus switch.

More info about VRF.

Leave a Reply

Your email address will not be published. Required fields are marked *