This is my second post on MPLS VPN. The first one that described Virtual Routing and Forwarding can be found here. Now I want to move on to MP-BGP component.
Why do we need MP-BGP?
We know that VRF instances are local for each router. Two different routers that have VRF instances configured for the same VPN have no idea that these two VRF instances belong to the same VPN even though these instances names or Route Distinguishers may match. But they need to exchange routes belonging to this VPN between themselves, i.e. send and receive them and insert received routes into correct VRF instance. How can we manage this? Well, this is what MP-BGP is used for. It permits exchanging routing information from different VRF together with VPN identification information.
Route Distinguishers and Route Targets
To differentiate routes belonging to different VRF instances MP-BGP uses Route Distinguishers and Route Target Import/Export parameters. The difference between RD and RT is the following:
Route Distinguisher is appended to IPv4-prefixes belonging to different VPNs when you set up MP-BGP and it makes the prefixes unique. Two 10.0.0.0/8 prefixes belonging to different VPNs will exist as something like RD1:10.0.0.0/8 and RD2:10.0.0.0/8 so BGP process won’t mix them up within the same physical router. However, this will not have any influence on whether these routes will be installed into certain VRFs in the peer routers that they will be sent to.
This other part is manupulated by Route Target parameter. Source router decides whether it wants to export certain Route Targets and then RT is sent within BGP Update as extended BGP community. At the receiving PE router VRF configuration determines routes with which RT it wants to import. Here is a configuration example:
R4 | R5 |
ip vrf network-a rd 64650:10 route-target export 64650:1 route-target import 65600:1 ip vrf network-b rd 64700:10 route-target export 64700:1 route-target import 64750:1 |
ip vrf network-a rd 65650:10 route-target export 65600:1 route-target import 64650:1 ip vrf network-b rd 64600:10 route-target export 64750:1 route-target import 64700:1 |
R4 will export routes from VRF network-a assigning them an RT of 64650:1 and R5 will install these routes into its network-a VRF as it has RT 64650:1 configured for import. R4 in turn will install routes coming from R5 with RT 65600:1 into network-a VRF. Similar exchange process will happen with network-b VRF.
MP-BGP Peering. Not to confuse with PE-CE VRF
PE router may have BGP peering with CE routers in order to exchange routes between Customer network and a VRF on PE router that is used to connect this Customer to Provider network. The terms Customer and Provider are applicable if we are talking of actually transporting some customer networks across some service provider network. MPLS VPN can be used in other circumstances where transport network and VPN networks belong to the same organization and the whole solution is used just to virtualize the networks. The concept, however, stays the same:
- Between PE routers and MP-BGP (VPNv4) peering is used
- Between PE and CE router classical IPv4 BGP peering is used but it is configured inside each customers (private network) VRF
BGP peering looks the following way (a lab example):

Full BGP configuration examples:
R4
router bgp 64600 |
R5
router bgp 64600 |
Here is all neighbors status:
R4
#sh bgp vpnv4 all neighbors | inc BGP |
|
R5
#sh bgp vpnv4 unicast all neighbors | inc BGP |
Here is an example of BGP VPNv4 Update message carrying both Route Distinguisher whithin NLRI and Route Target as Extended Community attribute for networks belonging to two configured VRF:
Route Distinguisher is carried together with network prefix information and Route Target – as an Extended BGP Community. AS-numbers are presented in asdot format so they look different from what is seen in the configuration.
Finally both routers have VPN routes from the other side present in correspondent VRF instances (local “customer” routes come from IPv4 session).
R4 VRF network-a
#sh ip route vrf network-a
|
R4 VRF network-b
#sh ip route vrf network-b
|
R5 VRF network-a
#sh ip route vrf network-a
|
R5 VRF network-b
#sh ip route vrf network-b
|