mplsGlobal Config

mpls ldp

Enters MPLS LDP configuration mode to enable and configure Label Distribution Protocol parameters.

Overview

The 'mpls ldp' command is used on Cisco IOS-XR routers to enter the Label Distribution Protocol (LDP) configuration submode. LDP is a protocol used in MPLS networks to distribute labels between routers, enabling label-switched paths (LSPs) for traffic engineering and VPN services. This command is the entry point for all LDP-related configurations, including setting the router ID, configuring session parameters, enabling LDP on interfaces, and setting up authentication. On IOS-XR, LDP is a separate configuration submode, distinct from other MPLS protocols like RSVP-TE. It is typically used when deploying MPLS in service provider or enterprise networks where label distribution is required. The command fits into troubleshooting workflows by allowing engineers to verify and adjust LDP settings that may affect label binding and forwarding.

Syntax·Global Config
mpls ldp

When to Use This Command

  • Enabling MPLS LDP on a router to distribute labels for MPLS forwarding.
  • Configuring LDP session parameters such as hello interval and hold time.
  • Setting up LDP authentication for secure label exchange.
  • Defining LDP label acceptance policies for route filtering.

Parameters

ParameterSyntaxDescription
No parametersmpls ldpThis command has no additional parameters. It simply enters the LDP configuration submode.

Command Examples

Enter MPLS LDP Configuration Mode

mpls ldp
RP/0/RP0/CPU0:router(config-ldp)#

The prompt changes to config-ldp, indicating you are now in MPLS LDP configuration submode.

Enable LDP on an Interface

interface GigabitEthernet0/0/0/0
RP/0/RP0/CPU0:router(config-ldp-if)#

Enters interface configuration submode under LDP, where you can enable LDP on that interface.

Understanding the Output

The command 'mpls ldp' itself does not produce output; it changes the CLI prompt to indicate you are in LDP configuration mode. The prompt 'RP/0/RP0/CPU0:router(config-ldp)#' confirms you are in the correct submode. From here, you can configure global LDP parameters like router-id, session protection, or enter interface submode. A healthy configuration shows the prompt without errors; problems occur if the command is rejected due to missing prerequisites (e.g., MPLS not enabled globally).

Configuration Scenarios

Basic LDP Configuration

Enable LDP on a router with a loopback interface as router ID and enable on a physical interface.

Topology

Router A --- Gig0/0/0/0 --- Router B

Steps

  1. 1.Enter global configuration mode.
  2. 2.Type 'mpls ldp' to enter LDP config.
  3. 3.Set router-id using 'router-id loopback0'.
  4. 4.Enter interface submode with 'interface GigabitEthernet0/0/0/0'.
  5. 5.Enable LDP on the interface with no additional command (just exit).
Configuration
!
mpls ldp
 router-id loopback0
 interface GigabitEthernet0/0/0/0
  !
!

Verify: Use 'show mpls ldp neighbor' to verify LDP session is up.

Watch out: The router-id must be an IP address of an existing interface; otherwise, LDP may not establish sessions.

Troubleshooting with This Command

When troubleshooting LDP issues on IOS-XR, start by verifying that LDP is configured globally with 'mpls ldp'. Use 'show mpls ldp neighbor' to check if LDP sessions are established. If no neighbors appear, ensure that interfaces have LDP enabled and that there is IP connectivity between routers. Check the LDP router ID with 'show mpls ldp parameters' to ensure it is reachable. Common issues include mismatched hello intervals or authentication keys. Use 'debug mpls ldp' to see packet exchanges, but be cautious in production. Also verify that MPLS is enabled globally with 'mpls oam' or 'mpls ip' on interfaces. On IOS-XR, LDP configuration is hierarchical; ensure you are in the correct submode. If LDP sessions flap, check for MTU issues or ACLs blocking UDP port 646.

CCNA Exam Tips

1.

Remember that 'mpls ldp' enters LDP configuration mode, not interface mode.

2.

On IOS-XR, LDP must be enabled globally before per-interface configuration.

3.

Know that the prompt changes to 'config-ldp' to distinguish from other configuration modes.

Common Mistakes

Typing 'mpls ldp' in global config without first enabling MPLS globally (needs 'mpls oam' or similar).

Confusing 'mpls ldp' with 'mpls ldp neighbor' or other subcommands.

Forgetting to exit LDP config mode before applying other global commands.

Platform Notes

On Cisco IOS-XR, the 'mpls ldp' command is used to enter LDP configuration mode, similar to IOS but with a different prompt. Unlike IOS, IOS-XR requires explicit 'commit' to apply changes. The configuration is stored in a hierarchical structure. Equivalent commands on other platforms: Juniper uses 'protocols ldp', Nokia uses 'router ldp'. IOS-XR supports LDP features like session protection, label filtering, and graceful restart. Version differences: In earlier IOS-XR releases, LDP configuration was under 'mpls ldp' but later versions may have additional submodes. Always check the release notes for specific syntax.

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions