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:

(config)#router ospf 1
(config-router)#network 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)#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:; Local LDP Ident
    Peer LDP Ident:; Local LDP Ident

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        0          Fa0/0 
17     17    0          Fa0/0 
18     18        0          Fa0/0 
19     Pop tag    0          Fa0/0 
20     Pop tag   0          Fa0/0 
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        0          Fa0/0 
17     Pop tag    0          Fa0/1 
18     Pop tag        0          Fa0/1 
19     Pop tag    0          Fa0/0 
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   0          Fa0/0 
17     16        0          Fa0/0 
18     Pop tag        0          Fa0/0 
19     Pop tag    0          Fa0/0 
20     19    0          Fa0/0

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 739 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

542 Sign Ups in the last 30 days

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


Forum Replies

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

  2. Hi Zaman,

    Think of an MPLS VPN network where we have PE and CE routers. The PE routers only require an LSP (Label Switched Path) between their loopback interfaces and the /32 IP address that is configured on these loopback interfaces. These are the IP addresses that are used for the next hops in BGP.

    By default, LDP creates and advertises a label for each and every prefix that is learned. This increases memory usage but also the number of advertisements between peers. If you only advertise labels for the LSPs that you need, you reduce convergence time and memory usage.

  3. 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 and labelled while and will not have labels, as expected.

    Similarly, R1 will see that is labelled while 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

  4. Hello,

    What is use-case to filter the label for the certain prefixes, does that means if prefixes doesn’t have a label and traffic to un-labeled prefixes will be drop or blackhole in transit.
    in this case R1 doesn’t have a label for R3 ( by virtue if access-list defined on R1 does that means traffic to destination from R1 will be drop?

  5. Loved this explanation, thanks Laz!

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