The longest-match command configures inter-domain LDP extension capability and enable LDP to search for routes to establish LSPs based on the longest match rule.
The undo longest-match command restores the default setting.
By default, LDP searches for routes to establish LSPs based on the exact matching rule.
Usage Scenario
On a large network, multiple IGP areas need to be configured for flexible network deployment and fast route convergence. In this situation, when advertising routes between IGP areas, to prevent a large number of routes from consuming too many resources, an Area Border Router (ABR) needs to aggregate the routes in an area and then advertise the aggregated route to neighbor IGP areas. By default, when establishing LSPs, LDP searches the routing table for the route that exactly matches the forwarding equivalence class (FEC) carried in the received Label Mapping message. For aggregated routes, only liberal LDP LSPs, not inter-area LDP LSPs, can be set up.
In this case, run the longest-match command to enable LDP to search for routes or establishing inter-area LDP LSPs based on the longest match rule.
Precautions
Configuring this command is not allowed during LDP GR.