< Home

(Optional) Configuring LDP Label Policies

You can configure LDP label policies to prevent the establishment of unwanted LSPs, saving memory resources.

Context

The LSR distributes labels to both upstream and downstream LDP peers, which increases the LDP LSP convergence speed. However, receiving and sending Label Mapping messages result in the establishments of a large number of LSPs, which wastes resources. To reduce the number of LSPs and save memory, use the following policies:

  • Configure the LSP label filtering policy.

    Configure LDP inbound policy or outbound policy to restrict the receiving and sending of Label Mapping messages.

  • Configure the LDP split horizon policy.

    Access devices on the MPLS network have low performance If LDP distributes labels to all peers, a large number of LSPs will be established, which cannot be processed by the LSR. The split horizon policy is recommended.

Procedure

  • Configure an inbound LDP policy.
    1. Access the system view.

      system-view

    2. Access the MPLS-LDP view.

      mpls ldp

    3. Configure an inbound policy for allowing the local LSR to receive label mapping messages from a specified LDP peer for a specified IGP route.

      inbound peer { peer-id | peer-group peer-group-name | all } fec { none | host | ip-prefix prefix-name }

      To apply a policy associated with a single FEC range to an LDP peer group or all LDP peers from which the local LSR receives Label Mapping messages, configure either the peer-group peer-group-name or all parameter in the command.

      If multiple inbound policies are configured for a specified LDP peer, the first configured one takes effect. For example, the following two inbound policies are configured:

      inbound peer 2.2.2.2 fec host
      inbound peer peer-group group1 fec none

      As group1 also contains an LDP peer with peer-id of 2.2.2.2, the following inbound policy takes effect:

      inbound peer 2.2.2.2 fec host

      If two inbound policies are configured in sequence and the peer parameters in the two commands are the same, the second command overwrites the first one. For example, the following two inbound policies are configured:

      inbound peer 2.2.2.2 fec host
      inbound peer 2.2.2.2 fec none

      The second configuration overwrites the first one. This means that the following inbound policy takes effect on the LDP peer with peer-id of 2.2.2.2:

      inbound peer 2.2.2.2 fec none

      MPLS and MPLS LDP must be enabled globally before an inbound policy is configured.

      To delete all inbound policies simultaneously, run the undo inbound peer all command.

  • Configure an outbound LDP policy.
    1. Access the system view.

      system-view

    2. Access the MPLS-LDP view.

      mpls ldp

    3. Perform either of the following steps to apply the outbound policy that allows Label Mapping messages for specified routes to be sent to a specified LDP peer:

      • Configure an outbound policy that allows Label Mapping messages for specified IGP routes to be sent to a specified LDP peer:

        outbound peer { peer-id | peer-group peer-group-name | all } fec { none | host | ip-prefix prefix-name }
      • Configure an outbound policy that allows Label Mapping messages for specified labeled BGP routes to be sent to a specified LDP peer:

        outbound peer { peer-id | peer-group peer-group-name | all } bgp-label-route { none | ip-prefix prefix-name }

      To apply a policy associated with a single FEC range to an LDP peer group or all LDP peers to which the local LSR sends Label Mapping messages, configure either the peer-group peer-group-name or all parameter in the command.

      If multiple outbound policies are configured for a specified LDP peer, the first configured one takes effect. For example, the following two outbound policies are configured:

      outbound peer 2.2.2.2 fec host
      outbound peer peer-group group1 fec none

      As group1 also contains an LDP peer with peer-id of 2.2.2.2, the following outbound policy takes effect:

      outbound peer 2.2.2.2 fec host

      If two outbound policies are configured in sequence and the peer parameters in the two commands are the same, the second command overwrites the first one. For example, the following two outbound policies are configured:

      outbound peer 2.2.2.2 fec host
      outbound peer 2.2.2.2 fec none

      The second configuration overwrites the first one. This means that the following outbound policy takes effect on the LDP peer with peer-id of 2.2.2.2:

      outbound peer 2.2.2.2 fec none

      MPLS and MPLS LDP must be enabled globally before an outbound policy is configured.

      To delete all outbound policies simultaneously, run the undo outbound peer all command.

  • Configuring an LDP Split Horizon Policy
    1. Access the system view.

      system-view

    2. Access the MPLS-LDP view.

      mpls ldp

    3. Configure a split horizon policy to distribute labels to only upstream LDP peers.

      outbound peer { peer-id | all } split-horizon

      By default, split horizon is not enabled and an LSR distributes labels to both upstream and downstream LDP peers.

      In the outbound peer command, configure either of the following parameters to prevent an LSR from distributing labels to specified downstream peers:

      • peer-id: prevents the LSR from distributing labels to a specified downstream peer.
      • all: prevents the LSR from distributing labels to all downstream peers.

      The all parameter takes preference over the peer-id parameter. For example, the outbound peer all split-horizon and then outbound peer 2.2.2.2 split-horizon commands are run, the outbound peer all split-horizon command can be saved in the configuration file and take effect, not the outbound peer 2.2.2.2 split-horizon command.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >