MPLS - Disabling IPv4 address family in BGP for VPNv4

When deploying MPLS in a Layer 3 VPN scenario, where VPNv4 is being used, by default the BGP configuration will enable the exchange of both VPNv4 routes as well as IPv4 unicast routes as well. There is no need to exchange IPv4 unicast routes, so such exchanges can be disabled.

This can be achieved by entering the IPv4 address-family configuration mode of the BGP configuration and disabling the BGP neighbor.

Take a look at the following MPLS topology: mpls-l3-vpn-pe-ce.png

PE1 and PE2 have been configured as iBGP peers. Let's say we want to disable the exchange of IPv4 unicast routes between PE1 and PE2. This can be achieved like so:

PE1(config)#router bgp 234 PE1(config-router)#address-family ipv4 PE1(config-router-af)#no neighbor activate
PE2(config)#router bgp 234 PE2(config-router)#address-family ipv4 PE2(config-router-af)#no neighbor activate

Note that in this case, the neighbor command has been removed only from the IPv4 address family. The neighbor command still exists in the main configuration section of the router bgp 234 configuration. Take a look at the full BGP configuration of PE1:

PE1#show run | section bgp router bgp 234 bgp log-neighbor-changes neighbor remote-as 234 neighbor update-source Loopback0 ! address-family ipv4 no neighbor activate exit-address-family ! address-family vpnv4 neighbor activate neighbor send-community extended exit-address-family

With this BGP configuration, we will use IPv4 to establish the neighbor adjacency but we won’t exchange IPv4 prefixes. The only thing we will exchange are VPNv4 routes.