Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configuring Longest Match for LDP

This example shows how to configure longest match for LDP based on RFC5283. This allows LDP to learn the routes aggregated or summarized across OSPF areas or ISIS levels in inter-domain.. The longest match policy provides per prefix granularity.

Requirements

This example uses the following hardware and software components:

  • Six MX Series routers with OSPF protocol, and LDP enabled on the connected interfaces.

  • Junos OS Release 16.1 or later running on all devices.

Before you begin:

  • Configure the device interfaces.

  • Configure OSPF.

Overview

LDP is often used to establish MPLS label-switched paths (LSPs) throughout a complete network domain using an IGP such as OSPF or IS-IS. In such a network, all links in the domain have IGP adjacencies as well as LDP adjacencies. LDP establishes the LSPs on the shortest path to a destination as determined by IP forwarding. In Junos OS, the LDP implementation does an exact match lookup on the IP address of the FEC in the RIB or IGP routes for label mapping. This exact mapping requires MPLS end-to-end LDP endpoint IP addresses to be configured in all the LERs. This defeats the purpose of IP hierarchical design or default routing in access devices. Configuring longest-match helps to overcome this by suppressing the exact match behaviour and setup LSP based on the longest matching route on per-prefix basis.

Topology

In the topology, Figure 1shows the longest match for LDP is configured on Device R0 .

Figure 1: Example Longest Match for LDP Network diagram with five routers labeled R0 to R4, connected by interfaces with IPs. Divided into AREA 0.0.0.0, 0.0.0.1, and 0.0.0.2 for OSPF routing.

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

R1

R2

R3

R4

R5

R6

Configuring Device R1

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R1:

  1. Set the system hostname.

  2. Configure the interfaces.

  3. Assign the loopback addresses to the device.

  4. Configure the router ID.

  5. Configure the MPLS protocol on the interface.

  6. Configure the OSPF protocol on the interface.

  7. Configure LDP protocol on the interface and longest match for the LDP protocol.

Results

From configuration mode, confirm your configuration by entering the show configuration | no-more command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, enter commit from the configuration mode.

Configuring Device R2

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R2:

  1. Set the system hostname.

  2. Configure the interfaces.

  3. Assign the loopback addresses to the device.

  4. Configure the router ID.

  5. Configure the MPLS protocol on the interface.

  6. Configure the OSPF protocol on the interface.

  7. Configure LDP protocol on the interfaces.

Results

From configuration mode, confirm your configuration by entering the show configuration | no-more command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, enter commit from the configuration mode.

Configuring Device R3

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R3:

  1. Set the system hostname.

  2. Configure the interfaces.

  3. Assign the loopback addresses to the device.

  4. Configure the router ID.

  5. Configure the MPLS protocol on the interface.

  6. Configure the OSPF protocol on the interface.

  7. Configure LDP protocol on the interface.

Results

From configuration mode, confirm your configuration by entering the show configuration | no-more command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, enter commit from the configuration mode.

Configuring Device R4

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R4:

  1. Set the system hostname.

  2. Configure the interfaces.

  3. Assign the loopback addresses to the device.

  4. Configure the router ID.

  5. Configure the MPLS protocol on the interface.

  6. Configure the OSPF protocol on the interface.

  7. Configure LDP protocol on the interface and longest match for the LDP protocol.

Results

From configuration mode, confirm your configuration by entering the show configuration | no-more command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, enter commit from the configuration mode.

Configuring Device R5

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R5:

  1. Set the system hostname.

  2. Configure the interfaces.

  3. Assign the loopback addresses to the device.

  4. Configure the router ID.

  5. Configure the MPLS protocol on the interface.

  6. Configure the OSPF protocol on the interface.

  7. Configure LDP protocol on the interface.

Results

From configuration mode, confirm your configuration by entering the show configuration | no-more command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, enter commit from the configuration mode.

Configuring Device R6

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R6:

  1. Set the system hostname.

  2. Configure the interfaces.

  3. Assign the loopback addresses to the device.

  4. Configure the router ID.

  5. Configure the MPLS protocol on the interface.

  6. Configure the OSPF protocol on the interface.

  7. Configure LDP protocol on the interface.

Results

From configuration mode, confirm your configuration by entering the show configuration | no-more command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, enter commit from the configuration mode.

Verification

Confirm that the configuration is working properly.

Verifying the Routes

Purpose

Verify that the expected routes are learned.

Action

On Device R4, from operational mode, run the show route table command to display the routes in the routing table.

Meaning

The output shows all the routes in the routing table of Device R4.

Verifying LDP Overview Information

Purpose

Display LDP overview information.

Action

On Device R4, from operational mode, run the show ldp overview command to display the overview of the LDP.

Meaning

The output displays the LDP overview information of Device R4.

Verify the LDP Entries in the Internal Topology Table

Purpose

Display the route entries in the Label Distribution Protocol (LDP) internal topology table.

Action

On Device R4, from operational mode, run the show ldp route command to display the internal topology table of LDP.

Meaning

The output displays the route entries in the Label Distribution Protocol (LDP) internal topology table of Device R4.

Verify Only FEC Information of LDP Route

Purpose

Display only the FEC information of LDP route.

Action

On Device R4, from operational mode, run the show ldp route fec-only command to display the routes in the routing table.

Meaning

The output displays only the FEC routes of LDP protocol available for Device R4.

Verify FEC and Shadow Routes of LDP

Purpose

Display the FEC and the shadow routes in the routing table.

Action

On Device R4, from operational mode, run the show ldp route fec-and-route command to display the FEC and shadow routes in the routing table.

Meaning

The output displays the FEC and the shadow routes of Device R4.