Nov 25 2008
MPLS Label Filtering
The MPLS label filtering feature is different to the limiting label distribution feature.
The MPLS Label filtering feature allows an administrator to control which Label bindings he learns from his neighboring MPLS nodes. This feature can be used to reduce the amount of memory used to store LDP label bindings advertised by other routers.
LSPs are usually only needed between PE routers. So you can use this feature on all PE routers to only accept label bindings for other PE routers.
Topology as below.
Watch the tutorial here.
We will configure PE1 to only accept LDP bindings for PE2s loopback address.
We will configure PE2 to only accept LDP bindings for PE1s loopback address.
Before we start lets check the LIB on PE1 and PE2.
PE1#show mpls ldp bindings
lib entry: 1.1.1.1/32, rev 4
local binding: label: imp-null
remote binding: lsr: 2.2.2.2:0, label: 17
lib entry: 2.2.2.2/32, rev 8
local binding: label: 16
remote binding: lsr: 2.2.2.2:0, label: imp-null
lib entry: 3.3.3.3/32, rev 18
local binding: label: 21
remote binding: lsr: 2.2.2.2:0, label: 18
lib entry: 10.0.0.0/30, rev 5
local binding: label: imp-null
remote binding: lsr: 2.2.2.2:0, label: imp-null
lib entry: 10.0.0.4/30, rev 12
local binding: label: 18
remote binding: lsr: 2.2.2.2:0, label: imp-null
lib entry: 20.0.0.0/30, rev 14
local binding: label: 19
remote binding: lsr: 2.2.2.2:0, label: imp-null
PE2#show mpls ldp bindings
lib entry: 1.1.1.1/32, rev 10
local binding: label: 17
remote binding: lsr: 2.2.2.2:0, label: 17
lib entry: 2.2.2.2/32, rev 8
local binding: label: 16
remote binding: lsr: 2.2.2.2:0, label: imp-null
lib entry: 3.3.3.3/32, rev 4
local binding: label: imp-null
remote binding: lsr: 2.2.2.2:0, label: 16
lib entry: 10.0.0.0/30, rev 12
local binding: label: 18
remote binding: lsr: 2.2.2.2:0, label: imp-null
lib entry: 10.0.0.4/30, rev 5
local binding: label: imp-null
remote binding: lsr: 2.2.2.2:0, label: imp-null
lib entry: 20.0.0.0/30, rev 14
local binding: label: 19
remote binding: lsr: 2.2.2.2:0, label: imp-null
lib entry: 31.31.31.31/32, rev 6
local binding: label: imp-null
PE2#
We apply the following commands to PE1
ip access-list standard MPLS
permit 3.3.3.3
mpls ldp neighbor 2.2.2.2 labels accept MPLS
We apply the following commands to PE2
ip access-list standard MPLS
permit 1.1.1.1
mpls ldp neighbor 2.2.2.2 labels accept MPLS
After the configuration we can see only a single remote binding on both PEs.
PE1#sh mpls ldp bindings
lib entry: 1.1.1.1/32, rev 4
local binding: label: imp-null
lib entry: 2.2.2.2/32, rev 8
local binding: label: 16
lib entry: 3.3.3.3/32, rev 10
local binding: label: 17
remote binding: lsr: 2.2.2.2:0, label: 16
lib entry: 10.0.0.0/30, rev 5
local binding: label: imp-null
lib entry: 10.0.0.4/30, rev 12
local binding: label: 18
lib entry: 20.0.0.0/30, rev 14
local binding: label: 19
PE2#show mpls ldp bindings
lib entry: 1.1.1.1/32, rev 10
local binding: label: 17
remote binding: lsr: 2.2.2.2:0, label: 17
lib entry: 2.2.2.2/32, rev 8
local binding: label: 16
lib entry: 3.3.3.3/32, rev 4
local binding: label: imp-null
lib entry: 10.0.0.0/30, rev 12
local binding: label: 18
lib entry: 10.0.0.4/30, rev 5
local binding: label: imp-null
lib entry: 20.0.0.0/30, rev 14
local binding: label: 19
lib entry: 31.31.31.31/32, rev 6
local binding: label: imp-null
Also if we check the LFIB we can see only the remote loopbacks have an outgoing label
PE1#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or VC or Tunnel Id Switched interface
16 No Label 2.2.2.2/32 0 Se1/1.1 point2point
17 16 3.3.3.3/32 0 Se1/1.1 point2point
18 No Label 10.0.0.4/30 0 Se1/1.1 point2point
19 No Label 20.0.0.0/30 0 Se1/1.1 point2point
20 No Label 11.0.0.0/30[V] 0 aggregate/CUST
21 Pop Label 11.11.11.11/32[V] 0 aggregate/CUST
PE2#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or VC or Tunnel Id Switched interface
16 No Label 2.2.2.2/32 0 Fa2/0 10.0.0.5
17 17 1.1.1.1/32 0 Fa2/0 10.0.0.5
18 No Label 10.0.0.0/30 0 Fa2/0 10.0.0.5
19 No Label 20.0.0.0/30 0 Fa2/0 10.0.0.5
20 No Label 12.0.0.0/30[V] 0 aggregate/CUST
21 Pop Label 12.12.12.12/32[V] 0 aggregate/CUST
PE2#

Jan 11, 2009 @ 03:24:38
Hi,
In this case, is the similar to mpls ldp advertise-label command?
Thanks in advance.
maher
Jan 12, 2009 @ 03:47:04
Hi Maher
It is similar, both acheive similar results, however one of them filters incoming labels and the other generates only pre-specified labels.
Zarar
Jan 12, 2009 @ 04:53:20
thanks Zarar.