示例:配置 IS-IS 和 LDP 之间的同步
此示例说明如何启用 IS-IS 和 LDP 之间的同步。
要求
开始之前,配置 IS-IS 和 LDP。有关示例,请参阅 示例:使用路由反射和 AS 覆盖配置第 3 层 VPN。
概述
LDP 在非流量工程应用程序中分发标签。标签沿 IS-IS 确定的最佳路径分布。如果 LDP 和 IS-IS 之间的同步丢失,则标签交换路径 (LSP) 将关闭。因此,LDP 和 IS-IS 同步是有益的。配置 LDP 同步且 LDP 在给定链路上未完全运行(未建立会话且未交换标签)时,IS-IS 会以最高成本指标播发链路。该链路不是首选链路,而是保留在网络拓扑中。
LDP 同步仅在 IS-IS 下配置为点对点接口的点对点接口和 LAN 接口上受支持。平滑重启期间不支持 LDP 同步。
要在 LDP 运行之前播发最大成本指标以实现 LDP 同步,请包含以下 ldp-synchronization
语句:
ldp-synchronization { disable; hold-time seconds; }
要禁用同步,请包含语 disable
句。要配置时间段以播发未完全运行的链接的最大成本指标,请包含语 hold-time
句。
当接口处于抑制状态超过 3 分钟时,将发送带有警告级别的系统日志消息。此消息同时显示在消息文件和跟踪文件中。
图 1 显示了此示例中使用的拓扑。

此示例介绍设备 P1 上的步骤。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层 [edit]
级的 CLI 中。
设备 P1
set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols isis interface all set protocols isis interface all ldp-synchronization set protocols isis interface all point-to-point set protocols isis interface fxp0.0 disable set protocols ldp interface all set protocols ldp interface fxp0.0 disable
我们保持配置简短,以便通过使用 interface all
在我们的接口上启用协议的方法更好地专注于 LDP 同步功能。在生产网络中,最佳做法是显式列出每个协议下的每个接口,以避免无意中在意外接口上启用协议。
使用接口所有方法时,最好在所有协议的使用中保持一致,如下所示。在这种情况下,它有助于确保不会无意中遗漏需要协议才能正常运行的接口上的协议支持。
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置 IS-IS 和 LDP 之间的同步:
-
在接口上启用 MPLS
[edit protocols mpls] user@P1# set interface all user@P1# set interface fxp0.0 disable
-
在接口上启用 IS-IS。
[edit protocols isis] user@P1# set interface all user@P1# set interface fxp0.0 disable
-
在接口上启用 LDP。
[edit protocols ldp] user@P1# set interface all user@P1# set interface fxp0.0 disable
-
在 IS-IS 接口上启用 LDP 同步。
[edit protocols isis interface all] user@P1# set ldp-synchronization
-
将 IS-IS 接口配置为类似于点对点接口。
[edit protocols isis interface all] user@P1# set point-to-point
结果
在配置模式下,输入 show protocols
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P1# show protocols
mpls {
interface all;
interface fxp0.0 {
disable;
}
}
isis {
interface all {
ldp-synchronization;
point-to-point;
}
interface fxp0.0 {
disable;
}
}
ldp {
interface all;
interface fxp0.0 {
disable;
}
}
如果完成设备配置,请从配置模式输入 commit
。在设备 R2 上重复配置。
验证
确认配置工作正常。
验证 LDP 同步
目的
检查 IS-IS 接口上的 LDP 同步设置。
行动
在作模式下,输入 show isis interface extensive
命令。
user@P1> show isis interface extensive IS-IS interface database: lo0.0 Index: 113, State: 0x6, Circuit id: 0x1, Circuit type: 0 LSP interval: 100 ms, CSNP interval: disabled, Loose Hello padding Adjacency advertisement: Advertise Level 1 Adjacencies: 0, Priority: 64, Metric: 0 Passive Level 2 Adjacencies: 0, Priority: 64, Metric: 0 Passive ge-1/2/0.0 Index: 116, State: 0x6, Circuit id: 0x1, Circuit type: 2 LSP interval: 100 ms, CSNP interval: 15 s, Loose Hello padding Adjacency advertisement: Advertise LDP sync state: in sync, for: 17:22:06, reason: LDP up during config config holdtime: infinity Level 2 Adjacencies: 1, Priority: 64, Metric: 10 Hello Interval: 9.000 s, Hold Time: 27 s ge-1/2/1.0 Index: 114, State: 0x6, Circuit id: 0x1, Circuit type: 2 LSP interval: 100 ms, CSNP interval: 15 s, Loose Hello padding Adjacency advertisement: Advertise LDP sync state: in sync, for: 17:22:06, reason: LDP up during config config holdtime: infinity Level 2 Adjacencies: 1, Priority: 64, Metric: 10 Hello Interval: 9.000 s, Hold Time: 27 s ge-1/2/2.0 Index: 115, State: 0x6, Circuit id: 0x1, Circuit type: 2 LSP interval: 100 ms, CSNP interval: 15 s, Loose Hello padding Adjacency advertisement: Advertise LDP sync state: in sync, for: 17:22:06, reason: LDP up during config config holdtime: infinity Level 2 Adjacencies: 1, Priority: 64, Metric: 10 Hello Interval: 9.000 s, Hold Time: 27 s
意义
输出显示 LDP 与 IS-IS 同步。