Ricardo Martins

Cisco Expert – MPLS and BGP – Part 2

Posted by Ricardo Martins on March 7, 2009

Alright, we have our network configured with OSPF in the transit links and we have a BGP peer session between R1 and R3. There’s only one little problem we must solve. R2 is not running BGP, therefore does not know about R1 and R3 LAN’s so is dropping any traffic for those destinations.

The solution will be enabling MPLS on the transit links between R1-R2-R3.

MPLS runs in 2 flavors, TDP and LDP. We can also use RSVP bandwidth reservations for MPLS Traffic Engineering Tunnels but that is for another day.
TDP is Cisco proprietary and stands for Tag Distribution Protocol which really is the old format for MPLS. Now, instead of tags it is called Labels.
LDP is a industry standard and stands for Lable Distribution protocol. Apart from this, they do pretty much similar.

Configuration wise, we are talking here about 2 or 3 commands, so no big deal but the concepts my friends are the problem. You have to understand the concept very well because later on when you get into MPLS VPN’s and QOS…well…Another day I will explain those topics


For now, we are going to enable MPLS.
In some IOS versions, TDP is the default, some other LDP, so check it!!!!
We are running LDP for sake of being the Industry Standard but again there’s no difference. Also be aware that some IOS versions take the command tag-switching ip, some other mpls ip. Also IP CEF is a must here.
Another very important aspect is that by default your MPLS adjacency router-id will be formed based on the highest loopback in the router and that loopback must be advertised into OSPF. So we have a problem here :). My LANs are Loppback 1, are not being advertised into OSPF and they are the highest ip. The solution is the optional command “mpls ldp router-id loopback 0 (force)”. If you are having problems, shut down the interfaces and use “force” keyword and bring them back up.

Rack1R1(config)#mpls label protocol ?
ldp Use LDP
tdp Use TDP (default)

R1 has TDP enabled my default, so I am going to change it to LDP.

R1(config)#ip cef
R1(config)#mpls ldp router-id loopback 0
R1(config)#mpls label protocol ldp
R1(config)#int e0/0
R1(config-if)#mpls ip

That’s it! Now I will enable it in all the transit links.

R2#sh mpls ldp neighbor
Peer LDP Ident:; Local LDP Ident
TCP connection: –
State: Oper; Msgs sent/rcvd: 10/11; Downstream
Up time: 00:01:21
LDP discovery sources:
FastEthernet0/1, Src IP addr:
Addresses bound to peer LDP Ident:
Peer LDP Ident:; Local LDP Ident
TCP connection: –
State: Oper; Msgs sent/rcvd: 10/10; Downstream
Up time: 00:01:15
LDP discovery sources:
FastEthernet0/0, Src IP addr:
Addresses bound to peer LDP Ident:

The process:
Now when R3 sends traffic from it’s LAN to R1’s LAN, it will sure work. Let’s check how do the routers route the traffic.

R3#sh ip route bgp is subnetted, 2 subnets
B [200/0] via, 00:03:43

R3 has via so it will make a lookup in the MPLS table for network

R3#sh mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 32 0 Et0/1

It says to get to PUSH a label 32 and send the traffic to the next hop address towards R2

R2 receives the traffic and checks the topmost Label of the packet which will be 32

R2#sh mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
32 Pop tag 3296 Fa0/0

R2 now will POP the Label 32 and send the traffic towards R1.

R1 receives the traffic for and knows that is directly connected.

Because this is a small topology we did not see one important step in MPLS. Imagine that between R2 and R3 we would have another router. That router would just SWAP the topmost label with another label and send the traffic to R2. Basically, labels are formed like this 16-17 17-18 18-19 19-20 and so on, so when a router sends a label, the other router is expecting that label.

In conclusion, there are 3 processes for MPLS, PUSH – SWAP – POP.

Final test, ping from R3’s LAN to R1’s LAN

R3#ping source lo1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to, timeout is 2 seconds:
Packet sent with a source address of
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

Now we have reachability!!

The MPLS routers on the core of the network they will not run BGP and have not routes for BGP networks, they will route the traffic based on LABELS only.  P->PE, Provider to Provider Edge, will always POP the label. Likewise, PE->P will always PUSH a Label. P->P will only SWAP a Label

This makes a lot of sense, If a ISP has 400 P routers and 100 PE routers, they only need to run BGP in 100 routers, COOL HA?

7 Responses to “Cisco Expert – MPLS and BGP – Part 2”

  1. Vignesh said

    Hello Ricardo,

    Do i need to publish the LAN of R1 and R3 in IGP also. Because i tried this same setup, but am not able to ping R3 to R1 Lan network and viceversa that are published in BGP. My igp is up and running fine and am using only one area. I can ping all the networks published in IGP but not the LAN network published in BGP.

    I sent a mail to Groupstudy and one GS folk replied that i need to publish that LAN network also in IGP or redistribute BGP into IGP else the intermediate router will not the LAN network. If so then what is the purpose of MPLS.

    Kindly advice me.


  2. Ricardo Martins said

    You dont need to publish the LAN’s, thats the whole point of running MPLS. The point is that your CORE dont need to know about the BGP routes.

    Send me your configs –

  3. Vignesh said

    Thanks Ricardo….I tried the setup in IE Vol1 Basic MPLS. It works perfectly but my own setup sucks. Anyways i understood and labbed up the concepts.

    Thanks for ur help.

  4. Hey, cool tips. Perhaps I’ll buy a glass of beer to that person from that forum who told me to visit your blog 🙂
    p.s. Year One is already on the Internet and you can watch it for free.

  5. maka said

    Nice article. In your lab, you are running MPLS on the actual routers where the two remote LANs originate, i.e. where they are connected.

    The funny thing (please correct me if I am wrong, I might very well be 🙂 ) for me about MPLS is that – if these two networks were not connected to routers in the same AS, but say received on P1 and P3 from external peers, the way to get them into MPLS is:

    – either to run MPLS on both the PE and CE (where the networks are coming from, which is what we do in the current lab), which puts a requirement on the customer, and therefore makes the technology less transparent, or at least as transparent as… ermm… BGP;
    – or we put static routes to these networks we receive from the CE (which we might possibly be doing anyway), which is a bit of an administrative burden…

  6. although I expend just about all of my afternoon on the web participating in video games like myspace poker or farmville, I always like to spend some free time to look through a couple of websites sometimes and I am proud to report this recent statement is in actual fact kind of good quality and drastically superior than 1 / 2 the various other poor quality junk I read today , at any rate i’m off to enjoy a couple of rounds of zynga poker

  7. Martin said

    AMAZING article, really ! 🙂
    Many thanks. I tried to set up something like that since days, but understanding how works MPLS with BGP and OSP interactions isn’t simple.
    Next step for me: VRFs !

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: