# MPLS LDP Label Filtering Example

**URL:** https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016
**Category:** Lessons Discussion
**Created:** [December 26, 2016, 6:12pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016 "2016-12-26T18:12:22Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [December 26, 2016, 6:12pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/1 "2016-12-26T18:12:22Z")

</div>

This topic is to discuss the following lesson:

> **[MPLS LDP Label Filtering Example](https://networklessons.com/mpls/mpls-ldp-label-filtering-example)**
>
> MPLS LDP Label Filtering can be used to decide which networks should be tagged or not.

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [September 24, 2014, 5:02am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/2 "2014-09-24T05:02:44Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [September 24, 2014, 6:38am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/3 "2014-09-24T06:38:21Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://cdn-forum.networklessons.com/uploads/default/original/1X/1d2ef66728c7fbac8377748594345a3f474fce5f.png) [@system](https://forum.networklessons.com/u/system)
#### Post date: [September 24, 2014, 10:28am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/4 "2014-09-24T10:28:35Z")

</div>

My bad. Just realized that r2 is between r1 and r3

---

<div class="post-metadata">

### Author: ![hamoodrehman87](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/h/50afbb/32.png) [@hamoodrehman87](https://forum.networklessons.com/u/hamoodrehman87)
#### Post date: [October 9, 2015, 5:06am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/5 "2015-10-09T05:06:57Z")

</div>

Rene,

Great lesson as usual. However, I have question loop backs which are not label it means they can not be reached and can not be in the routing table?

&nbsp;

Thanks

&nbsp;

Hamoood

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [October 9, 2015, 11:36am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/6 "2015-10-09T11:36:37Z")

</div>

Hi Hamood,

If there is no label for a prefix then we can still reach it through normal routing with the routing table, the only difference is that it won’t be label switched.

Rene

---

<div class="post-metadata">

### Author: ![pritibhaskarwar](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/p/f475e1/32.png) [@pritibhaskarwar](https://forum.networklessons.com/u/pritibhaskarwar)
#### Post date: [August 15, 2016, 7:29am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/7 "2016-08-15T07:29:08Z")

</div>

Good.! I had the same question what cla had. Thanks for answering Rene.!!

---

<div class="post-metadata">

### Author: ![sumit.bharti.2005](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/s/f05b48/32.png) [@sumit.bharti.2005](https://forum.networklessons.com/u/sumit.bharti.2005)
#### Post date: [July 6, 2017, 7:23am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/8 "2017-07-06T07:23:16Z")

</div>

why i am seeing TDP instead of LDP.

```
R1#show mpls ldp neighbor
    Peer TDP Ident: 22.22.22.22:0; Local TDP Ident 11.11.11.11:0
        TCP connection: 22.22.22.22.11014 - 11.11.11.11.711
        State: Oper; PIEs sent/rcvd: 5/5; Downstream
        Up time: 00:01:01
        TDP discovery sources:
          FastEthernet0/0, Src IP addr: 192.168.12.2
        Addresses bound to peer TDP Ident:
          192.168.12.2 2.2.2.2 22.22.22.22 192.168.23.2
R1#
R1#

```

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [July 7, 2017, 11:04am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/9 "2017-07-07T11:04:39Z")

</div>

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

```

---

<div class="post-metadata">

### Author: ![sumit.bharti.2005](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/s/f05b48/32.png) [@sumit.bharti.2005](https://forum.networklessons.com/u/sumit.bharti.2005)
#### Post date: [July 8, 2017, 1:27pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/10 "2017-07-08T13:27:04Z")

</div>

Thank you so much Rene…

---

<div class="post-metadata">

### Author: ![Zaman.rubd](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/z/45deac/32.png) [@Zaman.rubd](https://forum.networklessons.com/u/Zaman.rubd)
#### Post date: [November 23, 2017, 11:52am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/11 "2017-11-23T11:52:08Z")

</div>

Hi Rene,

I am little bit confused that where we can use the label filtering in Production network .I am looking for scenario where we deploy it . Thx

br//zaman

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [December 3, 2017, 9:44am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/12 "2017-12-03T09:44:31Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![bahriaygordu](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/bahriaygordu/32/1061_2.png) [@bahriaygordu](https://forum.networklessons.com/u/bahriaygordu)
#### Post date: [September 24, 2018, 5:15pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/13 "2018-09-24T17:15:42Z")

</div>

hi

```
R3(config)#access-list 1 permit 3.3.3.3 0.0.0.0
R3(config)#no mpls ldp advertise-labels
R3(config)#mpls ldp advertise-labels for 1

```

(mpls ldp advertise-labels for ) is a command ok but ( 1) what for i dont understand

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [September 25, 2018, 1:28pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/14 "2018-09-25T13:28:20Z")

</div>

Hello Bahri

The `mpls ldp advertise-labels for 1` command is used to control which labels are advertised to which LDP neighbors. The “1” at the end of the command indicates that it is the access list “1” which is configured above that will be used to filter the labels such that labels will be generated only for loopback 0. On R3, 3.3.3.3 is the IP address of loopback 0.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![staut\_stefanita](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/staut_stefanita/32/1652_2.png) [@staut\_stefanita](https://forum.networklessons.com/u/staut_stefanita)
#### Post date: [May 4, 2019, 4:00pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/15 "2019-05-04T16:00:11Z")

</div>

Hello,

I can see that “tag / pop tag” is used in the output. In the previous lesson “label / pop label” was used. Is there any difference?

Many thanks,  
Stefanita

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [May 6, 2019, 5:42am UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/16 "2019-05-06T05:42:51Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ahmed.salah1408](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/ahmed.salah1408/32/1740_2.png) [@ahmed.salah1408](https://forum.networklessons.com/u/ahmed.salah1408)
#### Post date: [June 26, 2019, 6:31pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/17 "2019-06-26T18:31:04Z")

</div>

Hello Rene,  
i still confused, where is the filter ? i mean i can see you filtered out all the prefixes not some of them, i think R3 should advertise 3.3.3.3 and filter out 33.33.33.33 but what really see it’s filter out both of them and R1,R2 the same problem.  
thanks to demonstrate.

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [June 27, 2019, 2:10pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/18 "2019-06-27T14:10:09Z")

</div>

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 also filter out those routes delivered from R3. So since both 3.3.3.3 and 33.33.33.33 are filtered out using R2’s filtering mechanism, these arrive at R1 untagged.

A similar situation occurs for routes that are advertised from R1 to R3 which affects how they appear in R3.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![ankisang](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@ankisang](https://forum.networklessons.com/u/ankisang)
#### Post date: [October 5, 2019, 7:46pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/19 "2019-10-05T19:46:14Z")

</div>

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 (3.3.3.3) by virtue if access-list defined on R1 does that means traffic to destination 3.3.3.3 from R1 will be drop?

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [October 7, 2019, 3:58pm UTC](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016/20 "2019-10-07T15:58:46Z")

</div>

Hell Ankit

It is useful to filter the label for certain prefixes if those prefixes need not be advertised on the MPLS network. Label filtering has a little bit of a different meaning than when we apply filtering to routing protocols. When applying filters to LDP labels, you are essentially deciding which prefixes will be labeled and which will not. Those that are labeled are participating in MLPS and thus are being sent from end to end of an MPLS network, while those that are filtered are simply not included as labels in the topology.

This is useful when you have certain networks that you don’t need to be advertised using labels on the MPLS network. This simply improves efficiency by reducing the amount of information that needs to be shared and processed. On a small network this might not seem very important, but on an MPLS network with hundreds or thousands of routers, this can save a substantial amount of bandwidth and resources.

I hope this has been helpful!

Laz

[Next page](https://forum.networklessons.com/t/mpls-ldp-label-filtering-example/1016.md?page=2)
