The maximum-link-cost command sets the maximum cost for OSPF links.
The undo maximum-link-cost command restores the default value.
By default, the maximum cost of OSPF links is 65535.
Usage Scenario
In an IGP-LDP synchronization scenario, when an LDP tunnel's next hop changes, a large number of entries need to be updated. If upstream and downstream forwarding entries reside on different boards, they may not be updated synchronously during traffic switchback. As a result, packet loss occurs if upstream forwarding entries are updated but downstream forwarding entries are not. To prevent packet loss, FRR forwarding entries can be created for the switchback path, and the link's primary/secondary status can be updated during traffic switchback. As defined in standard protocols, in an IGP-LDP synchronization scenario, if LDP is not in the fully operational state, OSPF needs to set the link cost to LSInfinity (65535). However, as defined in standard protocols, a link cannot participate in FRR route computation if its cost is 65535. To resolve this conflict in an IGP-LDP synchronization scenario, run the maximum-link-cost command to change the maximum cost for OSPF links.
This command also applies to stub-router and neighbor flapping suppression scenarios.