MPLS and LDP protocol must be enabled on the router to use LDP outbound FEC filtering.
device# configure terminal
device(config)# ip prefix-list list-out deny 10.40.40.0/24
device(config)# ip prefix-list list-out permit permit 0.0.0.0/0 ge 32
device(config)# router mpls
device(config-router-mpls)# ldp
device(config-router-mpls-ldp)# filter-fec-out list-out
In this example, LDP prevents advertisement of FEC 10.40.40.0/24 through the list-out prefix list and allows all others FECs to all neighbors.
Note
When the prefix list referenced by the LDP outbound FEC filter is configured or changed, all the existing outbound FECs and received later are subject to the changed prefix list. There is a configurable delay between changing the prefix list and the changed prefix list taking effect on LDP FEC filter configuration.device(config-router-mpls-ldp)# do show running-config router mpls ldp router mpls ldp .... filter-fec-out list-out ! !
The following example shows the previous steps to configure the LDP outbound FEC filter.
device# configure terminal device(config)# ip prefix-list list-out deny 10.40.40.0/24 device(config)# ip prefix-list list-out permit 0.0.0.0/0 ge 32 device(config)# router mpls device(config-router-mpls)# ldp device(config-router-mpls-ldp)# filter-fec-out list-out