MPLS VPN Configuration Example

This topic is to discuss the following lesson:

R3(config-router)#address-family vpnv4 
R3(config-router-af)#neighbor activate 
R3(config-router-af)#neighbor send-community extended 

what is the use of the above command.if we not provided these commands what will happened. could u explain each and every functionality of above command

BGP by default only carries IPv4 unicast prefixes. MP-BGP (Multiprotocol) lets us send other stuff like IPv6 or VPN routes for MPLS. A VPN route is a prefix + the 64-bit RD (Route distinguisher).

In order to send these VPN routes between BGP neighbors you need to activate the VPNv4 address family.

Extended communities are used for route import/export policies and also to carry OSPF or EIGRP attributes across MP-BGP.

I’ll write some more MPLS lessons in the future to explain it more.

Hi Rene - what about R2, don’t we need to configure VRF on R2 also? how the middle router will come to know about the VRF data, OR the middle one is only a transit router that works on MPLS BGP.

I’ll write some more mpls tutorials in the future, there’s plenty to talk about.

Hi Rene,

Thanks for these amazing tutorials,

When you configured OSPF, you already had reachability between R1 and R3, am I correct ? What is the use of configuring BGP ? When OSPF provided reach ability between these non directly connected networks.

Thanks a lot

Hi Charlot,

OSPF was used between the routers to advertise the loopback0 interfaces that are used for the MPLS peering. BGP (Multiprotocol BGP) is used to exchange the VPN routes from R1 to R3. One of the advantages of MPLS is that in this example, R1 and R3 can reach each others loopback1 interfaces while R2 doesn’t have a clue about those networks…it only has to “swap labels”.

The “core” of our network (R2 in this example) doesn’t require BGP anymore, it only has to worry about swapping labels. If we wouldn’t use MPLS then R2 would have to know about network /24 and /24 in order to forward IP packets.


as you said R2 is just transit an since we used MPLS , it will look at the lable stack and forward the packet.

Dear, Rene

Can you share me the program that you use to draw this Topology. I can’t do like that in Microsoft Visio. Thanks

Best Regard


I use Visio for all my topology pictures, the icons are from

Hi, Renee
Clear explanation,.
Can we use static routing instead of ospf?

Yes that’s possible, just make sure R1/R3 can reach each others loopback interfaces.

Any IGP or static routing is acceptable, just OSPF is most commonly used. You must have reachability to the BGP next hops on the PE routers, and likewise all MPLS routers must have labels for those endpoints (called the “transport” label). That is pretty much the only thing that matters with respect to the data plane. BGP automagically handles the VPN label advertisements by encoded them as extended communities within the VPNv4 update (along with the RD, RT, SoO, EIGRP Cost Community, and other fun stuff that may show up).

What routers did you use for this demo? I could not get it to work using my 2611’s or my 1841.

Hi Willie,

I’m not sure what routers I used, I think I did this on my 2811s but I believe the 1841 can do it too. Even in GNS3 the 3725 router should be able to do it.


Hi Rene,

Thanks for sharing the knowledge, could you focus on MPLS L2 VPN please?

You are welcome Pankaj, I’ll keep that in mind for the future.


2 things I don’t understand.
What is local LDP identifier for r2? Why that prefix?

Why is ospf advertising the exact IP address with wildcard mask ? Shouldn’t it be instead? I haven done bgp b4 so pardon my questions.

LDP uses a LDP identifier to name label spaces, it’s 6 bytes and made up with:

  • 4 bytes for the router ID
  • 2 bytes for the local label space ID

The router ID can be set manually with the mpls ldp router-id command or it will be selected automatically:

  1. If you have a loopback interface(s), it will use the highest IP address on your loopback interface(s).
  2. If you don't have a loopback interface, it will select the highest IP address of an operational interface.

The label space is a set of “possible labels”. There are two types of label spaces:

Interface-specific: this is where we use interface resources for labels.
Platform: the router used a “system wide” label space that is shared by all interfaces, Cisco uses this except for LC-ATM.

When you use platform wide label space the last two bytes are always 0.

So means that is our router ID and the 0 means we use platform wide label space for our label bindings.

About the OSPF network statements, on the FastEthernet interfaces it doesn’t matter if you use or Both will give you the exact same result.

I don’t understand. If you put instead of , how will it be able to reach the next hop? I don’t understand. In ccna they tell you to use for /24. Enlighten my little knowledge