MPLS LDP Label Filtering Example

Once you enable MPLS on the interfaces between the routers and LDP neighbor adjacencies have been formed, a label will be advertised for each network. With LDP however we can configure filters to decide what networks should get a label and which ones shouldn’t be tagged. I’ll use the following topology to demonstrate this:

MPLS LDP Filtering Example Topology

Above we have 3 routers and each router has 2 loopback interfaces so that we have plenty of networks to play with. Before we enable MPLS we’ll configure OSPF so that all networks are advertised:

R1,R2,R3:
(config)#router ospf 1
(config-router)#network 0.0.0.0 255.255.255.255 area 0

We’ll do this the easy way and activate OSPF on all interfaces. Now let’s enable MPLS on the FastEthernet interfaces:

R1(config)#interface fastEthernet 0/0
R1(config-if)#mpls ip
R2(config)#interface fastEthernet 0/0
R2(config-if)#mpls ip
R2(config-if)#exit
R2(config)#interface fastEthernet 0/1
R2(config-if)#mpls ip 
R3(config)#interface fastEthernet 0/0
R3(config-if)#mpls ip

Let’s check if we have LDP neighbors:

R2#show mpls ldp neighbor | include Peer
    Peer LDP Ident: 11.11.11.11:0; Local LDP Ident 22.22.22.22:0
    Peer LDP Ident: 33.33.33.33:0; Local LDP Ident 22.22.22.22:0

So far so good, now let’s take a look at the LDP labels that have been generated:

R1#show mpls forwarding-table 
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    
tag    tag or VC   or Tunnel Id      switched   interface              
16     Pop tag     2.2.2.2/32        0          Fa0/0      192.168.12.2 
17     17          33.33.33.33/32    0          Fa0/0      192.168.12.2 
18     18          3.3.3.3/32        0          Fa0/0      192.168.12.2 
19     Pop tag     22.22.22.22/32    0          Fa0/0      192.168.12.2 
20     Pop tag     192.168.23.0/24   0          Fa0/0      192.168.12.2 
R2#show mpls forwarding-table 
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    
tag    tag or VC   or Tunnel Id      switched   interface              
16     Pop tag     1.1.1.1/32        0          Fa0/0      192.168.12.1 
17     Pop tag     33.33.33.33/32    0          Fa0/1      192.168.23.3 
18     Pop tag     3.3.3.3/32        0          Fa0/1      192.168.23.3 
19     Pop tag     11.11.11.11/32    0          Fa0/0      192.168.12.1 
R3#show mpls forwarding-table 
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    
tag    tag or VC   or Tunnel Id      switched   interface              
16     Pop tag     192.168.12.0/24   0          Fa0/0      192.168.23.2 
17     16          1.1.1.1/32        0          Fa0/0      192.168.23.2 
18     Pop tag     2.2.2.2/32        0          Fa0/0      192.168.23.2 
19     Pop tag     22.22.22.22/32    0          Fa0/0      192.168.23.2 
20     19          11.11.11.11/32    0          Fa0/0      192.168.23.2

For all networks a label has been generated by LDP. Now let’s configure filtering so that we only generate labels for the loopback 0 interfaces. This is how you do it:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 651 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

567 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Forum Replies

  1. For r1 why is 3.3.3.3 untagged?
    Similar for r3 why is 1.1.1.1 untagged?

  2. That’s what this tutorial is about…filtering tags so not all prefixes get a tag. R2 only sends a tag for 2.2.2.2 /32 to R1 and R3, not for 1.1.1.1/32 or 3.3.3.3/32.

  3. TDP is the old Cisco equivalent protocol for LDP. LDP is an IETF standard. On older IOS versions, TDP is the default. Nowadays LDP is the default. There is a command to change the protocol:

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

  4. Hello Staut

    When speaking about MPLS, the term label and tag may be used interchangeably. The term label is the officially correct one, but keep in mind that in the context of MPLS, the term tag may be used as well.

    I hope this has been helpful!

    laz

  5. Hello Ahmed

    When the filtering mechanism is enabled on each router, it is applied for all networks whether those networks exist on the local router or are received and transmitted by intervening routers. What this means is that R2 will see 1.1.1.1 and 3.3.3.3 labelled while 11.11.11.11 and 33.33.33.33 will not have labels, as expected.

    Similarly, R1 will see that 2.2.2.2 is labelled while 22.22.22.22 will not have labels, again as expected. However, because R3 sends its information to R1 via R2, the mpls ldp advertise-labels for 1 command applied to R2 will a

    ... Continue reading in our forum

12 more replies! Ask a question or join the discussion by visiting our Community Forum