Course contents

Module 4: BGP Beyond IPv4 UnicastLesson 4.1 (1 of 2 in this module)10 of 11 in the Advanced BGP course

MP-BGP and MPLS L3VPN basics

VPNv4 routes, route distinguishers and route targets.

Advanced · 25 min read

You'll learn to explain what a VPNv4 route is, say what route distinguishers and route targets do, and read a VPNv4 table.

Why BGP carries more than IPv4

Standard BGP carries IPv4 unicast. Multiprotocol BGP (MP-BGP) adds the ability to carry other kinds of address information through address families. One of the most important is VPNv4, used by service providers to offer private networks to many customers over a shared MPLS core.

How a customer route crosses the provider
How a customer route crosses the providerThe route is placed in a VRF, made unique, tagged and carried between provider edge routers.CE to PEcustomer routeenters a VRFPE: make uniqueRD + prefix =VPNv4 routeMP-BGPcarries it tothe far PE with RTFar PEimports by RTinto its VRF

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The provider core never needs customer routes.

This is a basics lesson. It explains the vocabulary and reads a table. Building a complete MPLS core needs a course of its own.

How a VPNv4 route is built
How a VPNv4 route is builtA customer IPv4 prefix plus a route distinguisher forms a VPNv4 prefix. Route targets control which VRFs import it.Customer route10.1.0.0/16+Route distinguisher64500:1=VPNv4 prefix64500:1:10.1.0.0/16Route target export64500:100Remote VRF importsroute target 64500:100MP-BGP carries the VPNv4 routes between provider edge routers

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The route distinguisher makes overlapping customer addresses unique. The route target decides who may see the route.

The two numbers that matter

The route distinguisher (RD) is prepended to a customer prefix so overlapping addresses stay unique. The route target (RT) is an extended community attached to the route. A VRF exports routes with an RT and imports routes that carry the RT it is configured to import. That is how a provider decides which sites see which routes.

Route distinguisher and route target
Route distinguisher and route targetThey look similar and do different jobs.Route distinguisher (RD)Prepended to make overlapping prefixes uniqueRoute target (RT)An extended community that controls import and exportMPLS labelTells the far PE which VRF the packet belongs to

On small screens, swipe sideways or focus the diagram and use the arrow keys.

RD makes a prefix unique. RT decides which VRFs may import it.
vrf definition CUST-A rd 64500:1 address-family ipv4 route-target export 64500:100 route-target import 64500:100 exit-address-family router bgp 64500 neighbor 10.255.0.9 remote-as 64500 neighbor 10.255.0.9 update-source Loopback0 address-family vpnv4 neighbor 10.255.0.9 activate neighbor 10.255.0.9 send-community extended address-family ipv4 vrf CUST-A neighbor 192.0.2.10 remote-as 64510 neighbor 192.0.2.10 activate

A provider edge router. The vpnv4 session to the other edge router carries all customers. The VRF address family holds the customer's own eBGP session. Extended communities must be sent, or the route targets are lost.

Illustrative Cisco IOS XE output written for this lesson, not a router capture
PE1#show bgp vpnv4 unicast all
     Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 64500:1 (default for vrf CUST-A)
 *>  10.1.0.0/16      192.0.2.10               0             0 64510 i
 *>i 10.2.0.0/16      10.255.0.9               0    100      0 64511 i
Each route is grouped under its route distinguisher. The first was learned from the local customer, the second from the remote provider edge router over the vpnv4 session. These are customer prefixes, not core routes.

Technical reference: RFC 4364, BGP/MPLS IP Virtual Private Networks. Output above is illustrative.

Roles in a layer 3 VPN

Where each role sits in a layer 3 VPN
Where each role sits in a layer 3 VPNCustomer edge routers CE1 and CE2 connect to provider edge routers PE1 and PE2. The CE sees an ordinary neighbour. Each PE keeps the customer routes in a VRF. A provider core router P sits between the PEs and only forwards labelled packets. MP-BGP runs between PE1 and PE2 and carries the VPN routes with their route distinguishers and route targets.Provider networkCE1Customer site 1PE1VRF CUST-APlabel switching onlyPE2VRF CUST-ACE2Customer site 2MP-BGP: VPN routes with RD and RTCE: normal routereBGP or static to the PEPE: holds customer VRFsRD makes routes uniqueP: core, no customer routesforwards on labels

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The customer never sees the provider's addressing, and the P router never holds customer routes. Only the PEs know about the VPN, and they exchange its routes with MP-BGP.

Customer edge routers (CE) connect to provider edge routers (PE). Provider core routers (P) only forward labelled packets and need no customer routes. Only PE routers run VRFs and MP-BGP.

Roles in the provider network
Roles in the provider networkCE, PE and P each have a limited job.Provider networkCEcustomer router,ordinary routingPEVRFs, RD and RT,MP-BGP to other PEsPlabel forwardingonlyRoute reflectoroptional, for thePE mesh

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Keeping customer routes at the PE keeps the core small.

Check your understanding

Predict · scenario 1

Two customers both use 10.1.0.0/16. How does BGP keep them apart?

Predict · scenario 2

What decides which VRF imports a route?

Predict · scenario 3

Route targets are not reaching the remote edge router. What is a likely cause?

FAQ

Why is a route distinguisher needed?
Two customers may use the same private addresses. Adding a distinguisher makes each VPNv4 prefix unique so BGP can carry both.
Does the route distinguisher decide who sees a route?
No. Route targets do. The distinguisher only makes the prefix unique.
Where do labels come from?
MPLS. The provider core forwards using labels, and BGP distributes the VPN label that tells the egress router which VRF the packet belongs to.