Example: Configuring Synchronization Between LDP and OSPF
This example shows how to configure synchronization between LDP and OSPFv2.
Requirements
Before you begin:
- Configure the device interfaces. See the Junos OS Network Interfaces Library for Routing Devices.
- Configure the router identifiers for the devices in your OSPF network. See Example: Configuring an OSPF Router Identifier.
- Control OSPF designated router election. See Example: Controlling OSPF Designated Router Election
- Configure a single-area OSPF network. See Example: Configuring a Single-Area OSPF Network.
- Configure a multiarea OSPF network. See Example: Configuring a Multiarea OSPF Network.
Overview
In this example, configure synchronization between LDP and OSPFv2 by performing the following tasks:
- Enable LDP on interface so-1/0/3, which is a member of OSPF area 0.0.0.0, by including the ldp statement at the [edit protocols] hierarchy level. You can configure one or more interfaces. By default, LDP is disabled on the routing device.
- Enable LDP synchronization by including the ldp-synchronization statement at the [edit protocols ospf area area-id interface interface-name] hierarchy level. This statement enables LDP synchronization by advertising the maximum cost metric until LDP is operational on the link.
- Configure the amount of time (in seconds) the routing device advertises the maximum cost metric for a link that is not fully operational by including the hold-time statement at the [edit protocols ospf area area-id interface interface-name ldp-synchronization] hierarchy level. If you do not configure the hold-time statement, the hold-time value defaults to infinity. The range is from 1 through 65,535 seconds. In this example, configure 10 seconds for the hold-time interval.
This example also shows how to disable synchronization between LDP and OSPFv2 by including the disable statement at the [edit protocols ospf area area-id interface interface-name ldp-synchronization] hierarchy level.
Configuration
Enabling Synchronization Between LDP and OSPFv2
CLI Quick Configuration
The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Modifying the Junos OS Configuration in CLI User Guide.
To quickly enable synchronization between LDP and OSPFv2, copy the following commands, remove any line breaks, and then paste them into the CLI.
Step-by-Step Procedure
To enable synchronization between LDP and OSPFv2:
- Enable LDP on the interface.[edit]user@host# set protocols ldp interface so-1/0/3
- Configure LDP synchronization and optionally configure
a time period of 10 seconds to advertise the maximum cost metric for
a link that is not fully operational.[edit ]user@host# edit protocols ospf area 0.0.0.0 interface so-1/0/3 ldp-synchronization
- Configure a time period of 10 seconds to advertise the
maximum cost metric for a link that is not fully operational.[edit protocols ospf area 0.0.0.0 interface so-1/0/3 ldp-synchronization ]user@host# set hold-time 10
- If you are done configuring the device, commit the configuration.[edit protocols ospf area 0.0.0.0 interface so-1/0/3 ldp-synchronization]user@host# commit
Results
Confirm your configuration by entering the show protocols ldp and show protocols ospf commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Disabling Synchronization Between LDP and OSPFv2
CLI Quick Configuration
To quickly disable synchronization between LDP and OSPFv2, copy the following command and paste it into the CLI.
Step-by-Step Procedure
To disable synchronization between LDP and OSPF:
- Disable synchronization by including the disable statement.[edit ]user@host# set protocols ospf area 0.0.0.0 interface so-1/0/3 ldp-synchronization disable
- If you are done configuring the device, commit the configuration.[edit]user@host# commit
Results
Confirm your configuration by entering the show protocols ospf command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Verification
Confirm that the configuration is working properly.
Verifying the LDP Synchronization State of the Interface
Purpose
Verify the current state of LDP synchronization on the interface. The LDP sync state displays information related to the current state, and the config holdtime field displays the configured hold-time interval.
Action
From operational mode, enter the show ospf interface extensive command.