LDP 概述
LDP 简介
标签分发协议 (LDP) 是一种用于在非流量工程应用中分发标签的协议。LDP 允许路由器将网络层路由信息直接映射到数据链路层交换路径,从而通过网络建立标签交换路径 (LSP)。
这些 LSP 可能在直接连接的邻接方(类似于 IP 逐跳转发)或网络出口节点上有一个端点,从而支持通过所有中间节点进行交换。LDP 建立的 LSP 还可以遍历 RSVP 创建的流量工程 LSP。
LDP 将转发同等类 (FEC) 与其创建的每个 LSP 相关联。与 LSP 关联的 FEC 指定将哪些数据包映射到该 LSP。LSP 通过网络扩展,因为每个路由器选择下一跃点为 FEC 播发的标签,并将其拼接到它播发给所有其他路由器的标签。此过程形成一个 LSP 树,这些 LSP 会收敛到出口路由器上。
了解 LDP 信令协议
LDP 是在配置了支持 MPLS 的设备上运行的信令协议。成功配置 MPLS 和 LDP 后,将启动跨 LDP 接口的 TCP 数据包交换。这些数据包建立基于 TCP 的 LDP 会话,以便在网络内交换 MPLS 信息。在适当的接口上同时启用 MPLS 和 LDP 足以满足建立 LSP。
LDP 是一种简单、快速执行的信令协议,可在 MPLS 网络中自动建立 LSP 邻接。然后,路由器会跨邻接共享 LSP 更新,如 hello 数据包和 LSP 通告。由于 LDP 在 IGP(如 IS-IS 或 OSPF)之上运行,因此您必须在同一组接口上配置 LDP 和 IGP。配置完两者后,LDP 将开始通过所有支持 LDP 的接口发送和接收 LDP 消息。由于 LDP 的简单性,它无法执行 RSVP 可以执行的真正流量工程。LDP 不支持带宽预留或流量限制。
在 标签交换路由器 (标签交换路由器)上配置 LDP 时,路由器将开始从所有支持 LDP 的接口发送 LDP 发现消息。当相邻标签交换路由器收到 LDP 发现消息时,它将建立底层 TCP 会话。然后,将在 TCP 会话之上创建一个 LDP 会话。TCP 三次握手可确保 LDP 会话具有双向连接。LDP 邻接方建立 LDP 会话后,通过交换消息来维护和终止会话。LDP 播发消息允许 LSR 交换标签信息,以确定特定 LSP 内的下一跃点。任何拓扑更改(如路由器故障)都会生成 LDP 通知,这些通知可能会终止 LDP 会话或生成其他 LDP 播发以传播 LSP 更改。
从 Junos OS 20.3R1 版开始,支持 MPLS 提供具有控制平面功能的 LDP 信令协议配置。
示例:配置 LDP 信号 LSP
此示例说明如何在 MPLS 网络中创建和配置 LDP 实例。
要求
开始之前:
配置网络接口。请参阅 安全性设备接口用户指南。
在整个网络中配置 IGP。(LDP 配置将添加到现有 IGP 配置中,并包含在 MPLS 配置中。)
通过在MPLS网络中的所有传输接口上启用 MPLS,将网络配置为使用 LDP 建立 LSP。
注意:由于 LDP 在 IGP(如 IS-IS 或 OSPF)之上运行,因此您必须在同一组接口上配置 LDP 和 IGP。
概述
要配置 LDP 信号 LSP,您必须在 MPLS 网络中的所有传输接口上启用 MPLS 系列,并将所有传输接口包含在 [protocols mpls] 和 [protocols ldp] 层次结构级别下。
在此示例中,您将启用 MPLS 家族,并在所有传输接口上创建一个 LDP 实例。此外,您还可以在 MPLS 网络中的所有中转接口上启用 MPLS 进程。在此示例中,您将配置一个示例网络,如 图 1 所示。
配置
过程
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 [edit] CLI 中,然后从配置模式进入。commit
R1
set interfaces ge-0/0/0 unit 0 family mpls set protocols mpls ge-0/0/0 unit 0 set protocols ldp interface ge-0/0/0 unit 0
R2
set interfaces ge-0/0/0 unit 0 family mpls set protocols mpls ge-0/0/0 unit 0 set protocols ldp interface ge-0/0/0 unit 0 set interfaces ge-0/0/1 unit 0 family mpls set protocols mpls ge-0/0/1 unit 0 set protocols ldp interface ge-0/0/1 unit 0
R3
set interfaces ge-0/0/0 unit 0 family mpls set protocols mpls ge-0/0/0 unit 0 set protocols ldp interface ge-0/0/0 unit 0
分步程序
要在 MPLS 网络中启用 LDP 实例:
在路由器 R1 上的传输接口上启用 MPLS 家族。
[edit] user@R1# set interfaces ge-0/0/0 unit 0 family mpls
在传输接口上启用 MPLS 进程。
[edit] user@R1# set protocols mpls interface ge-0/0/0 unit 0
在传输接口上创建 LDP 实例。
[edit] user@R1# set protocols ldp interface ge-0/0/0 unit 0
结果
从配置模式输入 show 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明进行更正。
为简洁起见,此 show 输出仅包含与此示例相关的配置。系统上的任何其他配置都已替换为省略号 (...)。
user@R1# show
...
interfaces {
ge-0/0/0 {
unit 0 {
family inet {
address 10.100.37.20/24;
}
family mpls;
}
}
}
...
protocols {
mpls {
interface all;
}
ldp {
interface ge-0/0/0.0;
}
}
如果完成设备配置,请在配置模式下输入 commit 命令以激活配置。
Junos OS LDP 协议实施
LDP 的 Junos OS 实施支持 LDP 版本 1。Junos OS 支持一种简单的机制,用于在内部网关协议 (IGP) 中的路由器之间建立隧道,从而消除了在核心内分发外部路由所需的问题。Junos OS 允许将 MPLS 隧道下一跃点连接到网络中的所有出口路由器,只有在核心中运行的 IGP 才能将路由分发到出口路由器。边缘路由器运行 BGP,但不将外部路由分发到核心。相反,边缘的递归路由查找解析为切换到出口路由器的 LSP。传输 LDP 路由器上不需要外部路由。
LDP 操作
您必须为要运行 LDP 的每个接口配置 LDP。LDP 为作为下一跃点后续BGP的 路由器 ID 地址创建根于每个出口路由器的 LSP 树。入口点位于运行 LDP 的每台路由器上。此进程为每个出口路由器提供 inet.3 路由。如果 BGP 正在运行,它将尝试首先使用 inet.3 表解析下一跃点,该表将大多数(如果不是全部)BGP 路由绑定到 MPLS 隧道下一跃点。
运行 LDP 的两台相邻路由器成为邻居。如果两台路由器通过多个接口连接,则它们将成为每个接口上的邻接方。当 LDP 路由器成为邻居时,它们会建立一个 LDP 会话以交换标签信息。如果两个路由器上都使用了每个路由器的标签,则它们之间只会建立一个 LDP 会话,即使它们是多个接口上的邻接方也是如此。因此,LDP 会话与特定接口无关。
LDP 与单播路由协议一起运行。只有当同时启用 LDP 和路由协议时,LDP 才会安装 LSP。因此,您必须在同一组接口上同时启用 LDP 和路由协议。如果不这样做,可能无法在每出口路由器和所有入口路由器之间建立 LSP,这可能会导致 BGP 路由流量丢失。
您可以将策略过滤器应用于从 LDP 接收并分发到其他路由器的标签。策略过滤器为您提供了一种控制 LSP 建立的机制。
要让 LDP 在接口上运行,必须在该接口上的 逻辑接口 上启用 MPLS。有关更多信息,请参阅 逻辑接口。
LDP 消息类型
LDP 使用以下部分中所述的消息类型来建立和删除映射以及报告错误。所有 LDP 消息都有一个通用结构,使用类型、长度和值 (TLV) 编码方案。
发现消息
发现消息通告并维护网络中路由器的存在。路由器通过定期发送问候消息来指示它们在网络中的存在。hello 消息将作为 UDP 数据包传输到子网上所有路由器的组组播地址的 LDP 端口。
LDP 使用以下发现过程:
基本发现 — 路由器通过某个接口定期发送 LDP 链路 hello 消息。LDP 链路发送消息作为 UDP 数据包发送到 LDP 发现端口。在接口上收到 LDP 链路 hello 消息可识别与 LDP 对等路由器的邻接关系。
扩展发现 — LDP 扩展发现支持未直接连接的路由器之间的 LDP 会话。路由器会定期向特定地址发送 LDP 定向 hello 消息。有针对性的 hello 消息作为 UDP 数据包发送到特定地址的 LDP 发现端口。目标路由器决定是响应还是忽略目标 hello 消息。选择响应的目标路由器通过定期向发起路由器方发送有针对性的问候消息来实现响应。
会话消息
会话消息在 LDP 对等方之间建立、维护和终止会话。当路由器与通过 hello 消息获知的其他路由器建立会话时,它将通过 TCP 传输使用 LDP 初始化过程。初始化过程成功完成后,两台路由器成为 LDP 对等方,可以交换播发消息。
通告消息
播发消息可创建、更改和删除转发同等类 (FEC) 的标签映射。请求标签或播发标签映射到对等方是由本地路由器决定的。通常,路由器会在需要时向相邻路由器请求标签映射,并在希望邻接方使用标签时,将标签映射播发到相邻路由器。
通知消息
通知消息提供建议信息和信号错误信息。LDP 发送通知消息以报告错误和其他感兴趣的事件。LDP 通知消息有两种类型:
错误通知,发出致命错误信号。如果路由器收到来自对等方的 LDP 会话错误通知,则将关闭会话的 TCP 传输连接并丢弃通过会话获知的所有标签映射,从而终止 LDP 会话。
咨询通知,将有关 LDP 会话的信息或从对等方收到的先前消息的状态传递给路由器。
在 RSVP LSP 中建立 LDP LSP 隧道
您可以通过 RSVP LSP 隧道连接 LDP LSP。以下部分介绍 RSVP LSP 中 LDP LSP 的隧道工作原理:
RSVP LSP 中的 LDP LSP 隧道概述
如果将 RSVP 用于流量工程,则可以同时运行 LDP,以消除外部路由在核心中的分布。LDP 建立的 LSP 通过 RSVP 建立的 LSP 进行隧道传输。LDP 有效地将流量工程 LSP 视为单跃点。
将路由器配置为在 RSVP 建立的 LSP 上运行 LDP 时,LDP 会自动与 LSP 另一端的路由器建立会话。LDP 控制数据包逐跳路由,而不是通过 LSP 传输。此路由允许您使用单工(单向)流量工程 LSP。相反方向的流量流经遵循单播路由的 LDP 建立的 LSP,而不是通过流量工程隧道。
如果配置 LDP over RSVP LSP,您仍然可以在流量工程核心和周围的 LDP 云中配置多个 OSPF 区域和 IS-IS 级别。
从 Junos OS 15.1 版开始,多实例支持已扩展到虚拟路由器路由实例的 LDP over RSVP 隧道。这允许将单个路由和 MPLS 域拆分为多个域,以便每个域都可以独立扩展。BGP 标记的单播可用于拼接这些域以实现服务转发同等类 (FEC)。每个域都使用域内 LDP-over-RSVP LSP 进行 MPLS 转发。
引入对 LDP-over-RSVP LSP 的多实例支持后,您无法在已分配给其他路由实例的接口上启用 MPLS。在层次结构级别上 [edit protocols mpls] 添加属于其他路由实例的接口时,会在提交时引发配置错误。
在 RSVP LSP 中建立 LDP LSP 隧道的好处
在 RSVP LSP 中使用 LDP LSP 隧道可提供以下优势:
提供跨第 2 层和第 3 层 VPN 的不同流量类型(如 IPv4、IPv6、单播和组播)的融合。
支持灵活的接入连接选项,可以适应多种拓扑结构、不同的协议和多个管理边界。
实现多个提供商之间的安全互连。
由于 RSVP-流量工程支持流量工程、带宽保证以及链路和节点冗余功能,因此能够基于每个客户配置差异化服务。
减少了核心中所需的 LSP 数量,从而降低了协议和路由器的资源需求,并缩短了融合时间。
提供经济高效的部署,并将网络中断降至最低,因为 LSP 是使用指向直接连接邻居的点对点流量工程隧道构建的。这些流量工程隧道只会到达下一跳,而不是端到端。然后,当 LDP 通过这些隧道运行时,会话将构建到直接连接的邻接方。当网络发生变化(如添加新节点)时,新节点的直接连接邻接方将有 RSVP 和 LDP 会话。因此,RSVP LSP 仅用于下一跃点,LDP 负责新地址的广告标签。
通过 SR-流量工程实现 LDP 隧道
了解其优势并概述如何通过 SR-流量工程建立 LDP 隧道。
使用 LDP 相较于 SR-流量工程的隧道优势
可在核心网络中无缝集成 LDP over SR-流量工程。
提供灵活的连接选项以适应多种拓扑、协议和域。
在支持 LDP 和 SR 的设备之间实现互操作性。
利用 SR-流量工程负载分担功能。
在 SR-TE 域内使用拓扑无关环路备用 (TI-LFA),可以更快地恢复网络流量工程。如果主路径出现故障或变得不可用,使用 TI-LFA 的 SR 会立即将流量路由到备用路径或备用路径。
基于 SR 流量工程的 LDP 隧道概述
服务提供商通常会在其网络边缘使用 LDP 信令协议和 MPLS 传输。LDP 具有简单的优点,但 LDP 缺乏网络核心通常需要的流量工程 (流量工程) 和复杂的路径修复功能。许多服务提供商正在从 RSVP 迁移到核心中的分段路由流量工程 (SR-流量工程)。SR-流量工程在数据包网络中也称为源路由 (SPRING)。
在边缘运行 LDP 的路由器可能不支持 SR 功能。服务提供商可能希望继续在这些路由器上使用 LDP,以避免需要升级。在这种情况下,基于 SR 流量工程的 LDP 隧道功能提供了将不支持 SR 的路由器(运行 LDP)与支持 SR 的路由器(运行 SR-流量工程)集成的功能。
LDP LSP 通过 SR-流量工程网络建立隧道,使 LDP LSP 与 SR-流量工程 LSP 能够互连。例如,如果您在提供商边缘网络上有 LDP 域,在核心网络中有 SR-流量工程,那么您可以通过 SR-TE 连接 LDP 流量工程,如 图 2 所示。
通过 SR-流量工程建立 LDP 隧道可支持 LDP LSP 和 SR-流量工程 LSP 共存。
您还可以在连接到跨区域核心网络的 LDP 域之间通过 SR-流量工程建立 LDP 隧道。例如,如果您有多个区域 LDP 域连接到跨区域 SR-流量工程核心网络,则可以在跨区域 SR-流量工程核心网络中对 LDP 进行隧道传输,如 图 3 所示。
之间的 SR-流量工程 LDP
在 图 3 中,有三个运行 LDP 的区域网络(A、B 和 C)。这些区域 LDP 域连接到运行 SR-流量工程的各自区域核心网络。区域 SR-流量工程核心网络进一步与其他区域 SR-流量工程核心网络(跨区域核心网络)互连。您可以通过这些跨区域 SR-流量工程核心网络建立 LDP 隧道,并无缝部署第 3 层 VPN 等服务。此方案可用于移动回传网络,其中核心聚合层运行通过 SR-流量工程隧道传输的 LDP,而接入层仅运行 LDP。
要在 IS-IS 网络中通过 SR-流量工程启用 LDP 隧道,需要配置以下配置语句:
-
ldp-tunnelingedit protocols source-packet-routing source-routing-path source-routing-path-name以启用 SR-流量工程上的 LDP 隧道。 -
spring-te在 [edit protocols isis traffic-engineering tunnel-source-protocol] 层次结构级别,选择基于 SR-流量工程的 LDP LSP 作为隧道源协议。
要在 OSPF 网络中通过 SR-流量工程启用 LDP 隧道,需要配置以下配置语句:
-
ldp-tunnelingedit protocols source-packet-routing source-routing-path source-routing-path-name以启用 SR-流量工程上的 LDP 隧道。 -
spring-te在 [edit protocols ospf traffic-engineering tunnel-source-protocol] 层次结构级别,选择基于 SR-流量工程的 LDP LSP 作为隧道源协议。
您可以为 IGP(IS-IS 和 OSPF)配置多个隧道源协议,以创建快捷路由。当配置了多个隧道源协议,并且目标可以使用多个协议的隧道时,将建立具有最首选路由的隧道。例如,如果核心网络同时具有 RSVP LSP 和 SR-流量工程 LSP,并且同时为 RSVP 和 SR-流量工程 LSP 启用了 LDP 隧道, tunnel-source-protocol 则配置将根据优先级值选择隧道。优先级值最低的隧道是首选。您可以通过配置优先级值,使用所有目标的特定协议覆盖此路由优先级,如以下示例中所示:
[edit] user@host#set protocols isis traffic-engineering tunnel-source-protocol spring-te preference 2 user@host#set protocols isis traffic-engineering tunnel-source-protocol rsvp preference 5
[edit] user@host#set protocols ospf traffic-engineering tunnel-source-protocol spring-te preference 2 user@host#set protocols ospf traffic-engineering tunnel-source-protocol rsvp preference 5
在此示例中,您可以看到为 SR-流量工程隧道源协议配置的优先级值为 2,RSVP 隧道源协议的优先级值为 5。在这种情况下,首选 SR-流量工程隧道,因为与 RSVP 隧道源协议相比,它们具有最低的优先级值。
配置隧道源协议优先级值并非必需。如果多个隧道源协议具有相同的优先级值,则将根据到达目标的首选路径建立隧道。
目标 LDP 会话将建立,并在 SR-流量工程 LSP 启动时触发。LSP 会话将保持建立状态,直到移除 LDP 隧道 (ldp-tunneling) 配置,或从配置中移除 SR-流量工程 LSP。
Junos OS 当前不支持通过彩色 SR-流量工程 LSP 的 LDP。
示例:在 IS-IS 网络中通过 SR-流量工程建立 LDP 隧道
使用此示例了解如何在核心网络中通过 SR-流量工程对 LDP LSP 进行隧道传输。
我们的内容测试团队已验证并更新了此示例。
要求
此示例使用以下硬件和软件组件:
将 MX 系列路由器用作客户边缘路由器、PE 路由器和核心路由器。
-
所有设备上运行 Junos OS 20.3R1 或更高版本。
-
在 Junos OS 21.1R1 版上使用 vMX 进行了更新和重新验证。
-
概述
以下拓扑(图 4)显示了连接到 SR-流量工程 核心网络的两个 LDP 域(LDP 域 A 和 LDP 域 B),通过 SR-流量工程 隧道将它们扩展到核心。
拓扑结构
配置
要在核心网络中通过 SR-流量工程隧道 LDP LSP,请执行以下任务:
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 [edit] CLI 中,然后从配置模式进入。commit
设备 CE1
set chassis network-services enhanced-ip set interfaces ge-0/0/1 description CE1-to-PE1 set interfaces ge-0/0/1 unit 0 family inet address 10.1.1.1/24 set interfaces lo0 unit 0 family inet address 192.168.100.11/32 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options router-id 192.168.100.11
设备 PE1
set chassis network-services enhanced-ip set interfaces ge-0/0/1 description PE1-to-CE1 set interfaces ge-0/0/1 unit 0 family inet address 10.1.1.2/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/3 description PE1-to-R1 set interfaces ge-0/0/3 unit 0 family inet address 10.1.2.1/24 set interfaces ge-0/0/3 unit 0 family iso set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.100.5/32 set interfaces lo0 unit 0 family iso address 49.0004.0192.0168.0005.00 set interfaces lo0 unit 0 family mpls set policy-options policy-statement export_bgp term a from protocol bgp set policy-options policy-statement export_bgp term a from protocol direct set policy-options policy-statement export_bgp term a then accept set routing-instances CE1_vpn1 instance-type vrf set routing-instances CE1_vpn1 protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set routing-instances CE1_vpn1 protocols ospf export export_bgp set routing-instances CE1_vpn1 interface ge-0/0/1.0 set routing-instances CE1_vpn1 route-distinguisher 192.168.100.5:1 set routing-instances CE1_vpn1 vrf-target target:100:4 set routing-instances CE1_vpn1 vrf-table-label set protocols bgp group ibgp1 type internal set protocols bgp group ibgp1 local-address 192.168.100.5 set protocols bgp group ibgp1 family inet unicast set protocols bgp group ibgp1 family inet-vpn unicast set protocols bgp group ibgp1 neighbor 192.168.100.6 set protocols isis interface ge-0/0/3.0 point-to-point set protocols isis interface lo0.0 passive set protocols ldp interface ge-0/0/3.0 set protocols ldp interface lo0.0 set protocols mpls interface ge-0/0/3.0 set protocols mpls interface lo0.0 set routing-options router-id 192.168.100.5 set routing-options autonomous-system 65410
设备 R1
set chassis network-services enhanced-ip set interfaces ge-0/0/1 description R1-to-R2 set interfaces ge-0/0/1 unit 0 family inet address 10.1.3.1/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/2 description R1-to-R3 set interfaces ge-0/0/2 unit 0 family inet address 10.1.4.1/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/3 description R1-to-PE1 set interfaces ge-0/0/3 unit 0 family inet address 10.1.2.2/24 set interfaces ge-0/0/3 unit 0 family iso set interfaces ge-0/0/3 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.100.1/32 set interfaces lo0 unit 0 family iso address 49.0004.0192.0168.0001.00 set interfaces lo0 unit 0 family mpls set protocols isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment protected index 108 set protocols isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment unprotected index 110 set protocols isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment protected index 109 set protocols isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment unprotected index 111 set protocols isis interface ge-0/0/1.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/1.0 point-to-point set protocols isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment protected index 104 set protocols isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment unprotected index 106 set protocols isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment protected index 105 set protocols isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment unprotected index 107 set protocols isis interface ge-0/0/2.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface ge-0/0/3.0 level 2 ipv4-adjacency-segment protected index 100 set protocols isis interface ge-0/0/3.0 level 2 ipv4-adjacency-segment unprotected index 102 set protocols isis interface ge-0/0/3.0 level 2 ipv6-adjacency-segment protected index 101 set protocols isis interface ge-0/0/3.0 level 2 ipv6-adjacency-segment unprotected index 103 set protocols isis interface ge-0/0/3.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/3.0 point-to-point set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 80000 set protocols isis source-packet-routing srgb index-range 50000 set protocols isis source-packet-routing node-segment ipv4-index 5001 set protocols isis source-packet-routing node-segment ipv6-index 5501 set protocols isis level 1 disable set protocols isis backup-spf-options use-post-convergence-lfa set protocols isis backup-spf-options use-source-packet-routing set protocols isis traffic-engineering l3-unicast-topology set protocols isis traffic-engineering credibility-protocol-preference set protocols isis traffic-engineering tunnel-source-protocol spring-te set protocols ldp auto-targeted-session set protocols ldp preference 1 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface ge-0/0/3.0 set protocols ldp interface lo0.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols mpls interface ge-0/0/3.0 set protocols mpls interface lo0.0 set protocols source-packet-routing segment-list seg1 inherit-label-nexthops set protocols source-packet-routing segment-list seg1 auto-translate set protocols source-packet-routing segment-list seg1 hop1 ip-address 10.1.4.2 set protocols source-packet-routing segment-list seg1 hop2 ip-address 10.1.5.2 set protocols source-packet-routing segment-list seg1 hop3 ip-address 10.1.6.2 set protocols source-packet-routing source-routing-path sr_static_r5 ldp-tunneling set protocols source-packet-routing source-routing-path sr_static_r5 to 192.168.100.2 set protocols source-packet-routing source-routing-path sr_static_r5 binding-sid 1003001 set protocols source-packet-routing source-routing-path sr_static_r5 primary seg1 set routing-options router-id 192.168.100.1
设备 R2
set chassis network-services enhanced-ip set interfaces ge-0/0/1 description R2-to-R1 set interfaces ge-0/0/1 unit 0 family inet address 10.1.3.2/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/2 description R2-to-R4 set interfaces ge-0/0/2 unit 0 family inet address 10.1.6.2/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/3 description R2-to-PE2 set interfaces ge-0/0/3 unit 0 family inet address 10.1.7.1/24 set interfaces ge-0/0/3 unit 0 family iso set interfaces ge-0/0/3 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.100.2/32 set interfaces lo0 unit 0 family iso address 49.0004.0192.0168.0002.00 set interfaces lo0 unit 0 family mpls set protocols isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment protected index 500 set protocols isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment unprotected index 502 set protocols isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment protected index 501 set protocols isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment unprotected index 503 set protocols isis interface ge-0/0/1.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/1.0 point-to-point set protocols isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment protected index 504 set protocols isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment unprotected index 506 set protocols isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment protected index 505 set protocols isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment unprotected index 507 set protocols isis interface ge-0/0/2.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface ge-0/0/3.0 level 2 ipv4-adjacency-segment protected index 508 set protocols isis interface ge-0/0/3.0 level 2 ipv4-adjacency-segment unprotected index 510 set protocols isis interface ge-0/0/3.0 level 2 ipv6-adjacency-segment protected index 509 set protocols isis interface ge-0/0/3.0 level 2 ipv6-adjacency-segment unprotected index 511 set protocols isis interface ge-0/0/3.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/3.0 point-to-point set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 80000 set protocols isis source-packet-routing srgb index-range 50000 set protocols isis source-packet-routing node-segment ipv4-index 5005 set protocols isis source-packet-routing node-segment ipv6-index 5505 set protocols isis source-packet-routing traffic-statistics statistics-granularity per-interface set protocols isis level 1 disable set protocols isis backup-spf-options use-post-convergence-lfa set protocols isis backup-spf-options use-source-packet-routing set protocols isis traffic-engineering l3-unicast-topology set protocols isis traffic-engineering credibility-protocol-preference set protocols isis traffic-engineering tunnel-source-protocol spring-te set protocols ldp interface ge-0/0/1.0 set protocols ldp interface ge-0/0/3.0 set protocols ldp interface lo0.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols mpls interface ge-0/0/3.0 set protocols mpls interface lo0.0 set protocols source-packet-routing segment-list seg1 inherit-label-nexthops set protocols source-packet-routing segment-list seg1 auto-translate set protocols source-packet-routing segment-list seg1 hop1 ip-address 10.1.6.1 set protocols source-packet-routing segment-list seg1 hop2 ip-address 10.1.5.1 set protocols source-packet-routing segment-list seg1 hop3 ip-address 10.1.4.1 set protocols source-packet-routing source-routing-path sr_static_r1 ldp-tunneling set protocols source-packet-routing source-routing-path sr_static_r1 to 192.168.100.1 set protocols source-packet-routing source-routing-path sr_static_r1 binding-sid 1003001 set protocols source-packet-routing source-routing-path sr_static_r1 primary seg1 set routing-options router-id 192.168.100.2
设备 R3
set chassis network-services enhanced-ip set interfaces ge-0/0/1 description R3-to-R4 set interfaces ge-0/0/1 unit 0 family inet address 10.1.5.1/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 description R3-to-R1 set interfaces ge-0/0/2 unit 0 family inet address 10.1.4.2/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.100.3/32 set interfaces lo0 unit 0 family iso address 49.0004.0192.0168.0003.00 set interfaces lo0 unit 0 family mpls set protocols isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment protected index 204 set protocols isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment unprotected index 206 set protocols isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment protected index 205 set protocols isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment unprotected index 207 set protocols isis interface ge-0/0/1.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/1.0 point-to-point set protocols isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment protected index 200 set protocols isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment unprotected index 202 set protocols isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment protected index 201 set protocols isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment unprotected index 203 set protocols isis interface ge-0/0/2.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 80000 set protocols isis source-packet-routing srgb index-range 50000 set protocols isis source-packet-routing node-segment ipv4-index 5003 set protocols isis source-packet-routing node-segment ipv6-index 5503 set protocols isis level 1 disable set protocols isis backup-spf-options use-post-convergence-lfa set protocols isis backup-spf-options use-source-packet-routing set protocols isis traffic-engineering l3-unicast-topology set protocols isis traffic-engineering credibility-protocol-preference set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols mpls interface lo0.0 set routing-options router-id 192.168.100.3
设备 R4
set chassis network-services enhanced-ip set interfaces ge-0/0/1 description R4-to-R3 set interfaces ge-0/0/1 unit 0 family inet address 10.1.5.2/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 description R4-to-R2 set interfaces ge-0/0/2 unit 0 family inet address 10.1.6.1/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.100.4/32 set interfaces lo0 unit 0 family iso address 49.0004.0192.0168.0004.00 set interfaces lo0 unit 0 family mpls set protocols isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment protected index 300 set protocols isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment unprotected index 302 set protocols isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment protected index 301 set protocols isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment unprotected index 303 set protocols isis interface ge-0/0/1.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/1.0 point-to-point set protocols isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment protected index 304 set protocols isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment unprotected index 306 set protocols isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment protected index 305 set protocols isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment unprotected index 307 set protocols isis interface ge-0/0/2.0 level 2 post-convergence-lfa set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 80000 set protocols isis source-packet-routing srgb index-range 50000 set protocols isis source-packet-routing node-segment ipv4-index 5004 set protocols isis source-packet-routing node-segment ipv6-index 5504 set protocols isis source-packet-routing traffic-statistics statistics-granularity per-interface set protocols isis level 1 disable set protocols isis backup-spf-options use-post-convergence-lfa set protocols isis backup-spf-options use-source-packet-routing set protocols isis traffic-engineering l3-unicast-topology set protocols isis traffic-engineering credibility-protocol-preference set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols mpls interface lo0.0 set routing-options router-id 192.168.100.4
设备 PE2
set chassis network-services enhanced-ip set interfaces ge-0/0/2 description PE2-to-CE2 set interfaces ge-0/0/2 unit 0 family inet address 10.1.8.1/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/3 description PE2-to-R2 set interfaces ge-0/0/3 unit 0 family inet address 10.1.7.2/24 set interfaces ge-0/0/3 unit 0 family iso set interfaces ge-0/0/3 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.100.6/32 set interfaces lo0 unit 0 family iso address 49.0004.0192.0168.0006.00 set interfaces lo0 unit 0 family mpls set policy-options policy-statement export_bgp term a from protocol bgp set policy-options policy-statement export_bgp term a from protocol direct set policy-options policy-statement export_bgp term a then accept set routing-instances CE2_vpn1 instance-type vrf set routing-instances CE2_vpn1 protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set routing-instances CE2_vpn1 protocols ospf export export_bgp set routing-instances CE2_vpn1 interface ge-0/0/2.0 set routing-instances CE2_vpn1 route-distinguisher 192.168.100.6:1 set routing-instances CE2_vpn1 vrf-target target:100:4 set routing-instances CE2_vpn1 vrf-table-label set protocols bgp group ibgp1 type internal set protocols bgp group ibgp1 local-address 192.168.100.6 set protocols bgp group ibgp1 family inet unicast set protocols bgp group ibgp1 family inet-vpn unicast set protocols bgp group ibgp1 neighbor 192.168.100.5 set protocols isis interface ge-0/0/3.0 point-to-point set protocols isis interface lo0.0 passive set protocols ldp interface ge-0/0/3.0 set protocols ldp interface lo0.0 set protocols mpls interface ge-0/0/3.0 set protocols mpls interface lo0.0 set routing-options router-id 192.168.100.6 set routing-options autonomous-system 65410
设备 CE2
set chassis network-services enhanced-ip set interfaces ge-0/0/1 description CE2-to-PE2 set interfaces ge-0/0/2 unit 0 family inet address 10.1.8.2/24 set interfaces lo0 unit 0 family inet address 192.168.100.22/32 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options router-id 192.168.100.22
配置 PE1
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅 《CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置设备 PE1:
将网络服务模式配置为增强型 IP。增强型 IP 会将路由器的网络服务设置为增强型互联网协议,并使用增强型模式功能。
[edit chassis] user@PE1#set network-services enhanced-ip
配置语
enhanced-ip句并提交配置后,将显示以下警告消息,提示您重新启动路由器:'chassis' WARNING: Chassis configuration for network services has been changed. A system reboot is mandatory. Please reboot the system NOW. Continuing without a reboot might result in unexpected system behavior. commit complete
重新启动将启动路由器上的 FPC。
-
配置设备的接口。
[edit interfaces] user@PE1#set ge-0/0/1 description PE1-to-CE1 user@PE1#set ge-0/0/1 unit 0 family inet address 10.1.1.2/24 user@PE1#set ge-0/0/1 unit 0 family iso user@PE1#set ge-0/0/3 description PE1-to-R1 user@PE1#set ge-0/0/3 unit 0 family inet address 10.1.2.1/24 user@PE1#set ge-0/0/3 unit 0 family iso user@PE1#set ge-0/0/3 unit 0 family mpls user@PE1#set lo0 unit 0 family inet address 192.168.100.5/32 user@PE1#set lo0 unit 0 family iso address 49.0004.0192.0168.0005.00 user@PE1#set lo0 unit 0 family mpls
-
配置策略选项以将BGP路由导出到 客户边缘 路由器(在本例中运行 OSPF 协议)。
[edit policy-options] user@PE1#set policy-statement export_bgp term a from protocol bgp user@PE1#set policy-statement export_bgp term a from protocol direct user@PE1#set policy-statement export_bgp term a then accept
-
配置第 3 层 VPN 路由实例以支持基于 OSPF 的 CE1 设备。
[edit routing-instances] user@PE1#set CE1_vpn1 instance-type vrf user@PE1#set CE1_vpn1 protocols ospf area 0.0.0.0 interface ge-0/0/1.0 user@PE1#set CE1_vpn1 protocols ospf export export_bgp user@PE1#set CE1_vpn1 interface ge-0/0/1.0 user@PE1#set CE1_vpn1 route-distinguisher 192.168.100.5:1 user@PE1#set CE1_vpn1 vrf-target target:100:4 user@PE1#set CE1_vpn1 vrf-table-label
-
为设备 PE1 配置路由器 ID 和自治系统编号。
[edit routing-options] user@PE1#set router-id 192.168.100.5 userPE1# set autonomous-system 65410
-
在连接到核心网络的接口上配置 IS-IS、LDP 和 MPLS。
[edit protocols] user@PE1#set isis interface ge-0/0/3.0 point-to-point user@PE1#set isis interface lo0.0 passive user@PE1#set ldp interface ge-0/0/3.0 user@PE1#set ldp interface lo0.0 user@PE1#set mpls interface ge-0/0/3.0 user@PE1#set mpls interface lo0.0
-
在 PE 设备之间配置 BGP。
[edit protocols] user@PE1#set bgp group ibgp1 type internal user@PE1#set bgp group ibgp1 local-address 192.168.100.5 user@PE1#set bgp group ibgp1 family inet unicast user@PE1#set bgp group ibgp1 family inet-vpn unicast user@PE1#set bgp group ibgp1 neighbor 192.168.100.6
结果
在配置模式下,输入 show chassis、 show interfaces、 show policy-optionsshow routing-instances、show routing-options 和show protocols命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@PE1#show chassis network-services enhanced-ip;
user@PE1#show interfaces
ge-0/0/1 {
description PE1-to-CE1;
unit 0 {
family inet {
address 10.1.1.2/24;
}
family iso;
}
}
ge-0/0/3 {
description PE1-to-R1;
unit 0 {
family inet {
address 10.1.2.1/24;
}
family iso;
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 192.168.100.5/32;
}
family iso {
address 49.0004.0192.0168.0005.00;
}
family mpls;
}
}
user@PE1#show policy-options
policy-statement export_bgp {
term a {
from protocol [ bgp direct ];
then accept;
}
}
user@PE1#show routing-instances
CE1_vpn1 {
instance-type vrf;
protocols {
ospf {
area 0.0.0.0 {
interface ge-0/0/1.0;
}
export export_bgp;
}
}
interface ge-0/0/1.0;
route-distinguisher 192.168.100.5:1;
vrf-target target:100:4;
vrf-table-label;
}
user@PE1#show routing-options router-id 192.168.100.5; autonomous-system 65410;
user@PE1#show protocols
bgp {
group ibgp1 {
type internal;
local-address 192.168.100.5;
family inet {
unicast;
}
family inet-vpn {
unicast;
}
neighbor 192.168.100.6;
}
}
isis {
interface ge-0/0/3.0 {
point-to-point;
}
interface lo0.0 {
passive;
}
}
ldp {
interface ge-0/0/3.0;
interface lo0.0;
}
mpls {
interface ge-0/0/3.0;
interface lo0.0;
}
配置 R1 设备
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅 《CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置设备 R1:
将网络服务模式配置为增强型 IP。增强型 IP 会将路由器的网络服务设置为增强型互联网协议,并使用增强型模式功能。
[edit chassis] user@R1#set network-services enhanced-ip
配置语
enhanced-ip句并提交配置后,将显示以下警告消息,提示您重新启动路由器:'chassis' WARNING: Chassis configuration for network services has been changed. A system reboot is mandatory. Please reboot the system NOW. Continuing without a reboot might result in unexpected system behavior. commit complete
重新启动将启动路由器上的 FPC。
-
配置设备的接口。
[edit interfaces] user@R1#set ge-0/0/1 description R1-to-R2 user@R1#set ge-0/0/1 unit 0 family inet address 10.1.3.1/24 user@R1#set ge-0/0/1 unit 0 family iso user@R1#set ge-0/0/1 unit 0 family mpls maximum-labels 8 user@R1#set ge-0/0/2 description R1-to-R3 user@R1#set ge-0/0/2 unit 0 family inet address 10.1.4.1/24 user@R1#set ge-0/0/2 unit 0 family iso user@R1#set ge-0/0/2 unit 0 family mpls maximum-labels 8 user@R1#set ge-0/0/3 description R1-to-PE1 user@R1#set ge-0/0/3 unit 0 family inet address 10.1.2.2/24 user@R1#set ge-0/0/3 unit 0 family iso user@R1#set ge-0/0/3 unit 0 family mpls maximum-labels 8 user@R1#set lo0 unit 0 family inet address 192.168.100.1/32 user@R1#set lo0 unit 0 family iso address 49.0004.0192.0168.0001.00 user@R1#set lo0 unit 0 family mpls
配置路由选项以识别域中的路由器。
[edit routing-options] user@R1#set router-id 192.168.100.1
-
在接口上配置 IS-IS 邻接 SID 并分配 SRGB 标签以启用分段路由。整个 SRGB 中的标签可用于 IS-IS。前缀 SID(和节点 SID)从 SRGB 编制索引。
[edit protocols] user@R1#set isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment protected index 108 user@R1#set isis interface ge-0/0/1.0 level 2 ipv4-adjacency-segment unprotected index 110 user@R1#set isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment protected index 109 user@R1#set isis interface ge-0/0/1.0 level 2 ipv6-adjacency-segment unprotected index 111 user@R1#set isis interface ge-0/0/1.0 level 2 post-convergence-lfa user@R1#set isis interface ge-0/0/1.0 point-to-point user@R1#set isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment protected index 104 user@R1#set isis interface ge-0/0/2.0 level 2 ipv4-adjacency-segment unprotected index 106 user@R1#set isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment protected index 105 user@R1#set isis interface ge-0/0/2.0 level 2 ipv6-adjacency-segment unprotected index 107 user@R1#set isis interface ge-0/0/2.0 level 2 post-convergence-lfa user@R1#set isis interface ge-0/0/2.0 point-to-point user@R1#set isis interface ge-0/0/3.0 level 2 ipv4-adjacency-segment protected index 100 user@R1#set isis interface ge-0/0/3.0 level 2 ipv4-adjacency-segment unprotected index 102 user@R1#set isis interface ge-0/0/3.0 level 2 ipv6-adjacency-segment protected index 101 user@R1#set isis interface ge-0/0/3.0 level 2 ipv6-adjacency-segment unprotected index 103 user@R1#set isis interface ge-0/0/3.0 level 2 post-convergence-lfa user@R1#set isis interface ge-0/0/3.0 point-to-point user@R1#set isis interface lo0.0 passive user@R1#set isis source-packet-routing srgb start-label 80000 user@R1#set isis source-packet-routing srgb index-range 50000 user@R1#set isis source-packet-routing node-segment ipv4-index 5001 user@R1#set isis source-packet-routing node-segment ipv6-index 5501 user@R1#set isis level 1 disable
配置 TI-LFA 以启用针对链路和节点故障的保护。如果主路径出现故障或变得不可用,使用 TI-LFA 的 SR 会立即将流量路由到备用路径或备用路径,从而更快地恢复网络连接。
[edit protocols] user@R1#set isis backup-spf-options use-post-convergence-lfa user@R1#set isis backup-spf-options use-source-packet-routing
配置 IS-IS 流量工程参数。
[edit protocols] user@R1#set isis traffic-engineering l3-unicast-topology user@R1#set isis traffic-engineering credibility-protocol-preference
通过 SR-流量工程启用 LDP 隧道。
[edit protocols] user@R1#set isis traffic-engineering tunnel-source-protocol spring-te
在 LDP 域中的接口上配置 MPLS 和 LDP 协议,以便在 LDP 域中交换标签。
[edit protocols] user@R1#set ldp preference 1 user@R1#set ldp interface ge-0/0/3.0 user@R1#set ldp interface lo0.0 user@R1#set mpls interface ge-0/0/1.0 user@R1#set mpls interface ge-0/0/2.0 user@R1#set mpls interface ge-0/0/3.0 user@R1#set mpls interface lo0.0
在 LDP 域中的边缘路由器之间启用有针对性的 LDP 会话。
[edit protocols] user@R1#set ldp auto-targeted-session
配置分段列表以将流量路由到特定路径。
[edit protocols] user@R1#set source-packet-routing segment-list seg1 inherit-label-nexthops user@R1#set source-packet-routing segment-list seg1 auto-translate user@R1#set source-packet-routing segment-list seg1 hop1 ip-address 192.168.4.2 user@R1#set source-packet-routing segment-list seg1 hop2 ip-address 192.168.5.2 user@R1#set source-packet-routing segment-list seg1 hop3 ip-address 192.168.6.2
将 SR-流量工程 LSP 配置到远程边缘路由器,以启用 SR-TE 上的 LDP 流量工程隧道。
[edit protocols] user@R1#set source-packet-routing source-routing-path sr_static_r5 ldp-tunneling user@R1#set source-packet-routing source-routing-path sr_static_r5 to 192.168.66.66 user@R1#set source-packet-routing source-routing-path sr_static_r5 binding-sid 1003001 user@R1#set source-packet-routing source-routing-path sr_static_r5 primary seg1
结果
在配置模式下,输入 show chassis、 show interfaces、 show routing-options和 show protocols 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R1#show chassis network-services enhanced-ip;
user@R1#show interfaces
ge-0/0/1 {
description R1-to-R2;
unit 0 {
family inet {
address 10.1.3.1/24;
}
family iso;
family mpls {
maximum-labels 8;
}
}
}
ge-0/0/2 {
description R1-to-R3;
unit 0 {
family inet {
address 10.1.4.1/24;
}
family iso;
family mpls {
maximum-labels 8;
}
}
}
ge-0/0/3 {
description R1-to-PE1;
unit 0 {
family inet {
address 10.1.2.2/24;
}
family iso;
family mpls {
maximum-labels 8;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.100.1/32;
}
family iso {
address 49.0004.0192.0168.0001.00;
}
family mpls;
}
}
user@R1#show protocols
isis {
interface ge-0/0/1.0 {
level 2 {
ipv4-adjacency-segment {
protected index 108;
unprotected index 110;
}
ipv6-adjacency-segment {
protected index 109;
unprotected index 111;
}
post-convergence-lfa;
}
point-to-point;
}
interface ge-0/0/2.0 {
level 2 {
ipv4-adjacency-segment {
protected index 104;
unprotected index 106;
}
ipv6-adjacency-segment {
protected index 105;
unprotected index 107;
}
post-convergence-lfa;
}
point-to-point;
}
interface ge-0/0/3.0 {
level 2 {
ipv4-adjacency-segment {
protected index 100;
unprotected index 102;
}
ipv6-adjacency-segment {
protected index 101;
unprotected index 103;
}
post-convergence-lfa;
}
point-to-point;
}
interface lo0.0 {
passive;
}
source-packet-routing {
srgb start-label 80000 index-range 50000;
node-segment {
ipv4-index 5001;
ipv6-index 5501;
}
}
level 1 disable;
backup-spf-options {
use-post-convergence-lfa;
use-source-packet-routing;
}
traffic-engineering {
l3-unicast-topology;
credibility-protocol-preference;
tunnel-source-protocol {
spring-te;
}
}
}
ldp {
auto-targeted-session;
preference 1;
interface ge-0/0/3.0;
interface lo0.0;
}
mpls {
interface ge-0/0/1.0;
interface ge-0/0/2.0;
interface ge-0/0/3.0;
interface lo0.0;
}
source-packet-routing {
segment-list seg1 {
inherit-label-nexthops;
auto-translate;
hop1 ip-address 10.1.4.2;
hop2 ip-address 10.1.5.2;
hop3 ip-address 10.1.6.2;
}
source-routing-path sr_static_r5 {
ldp-tunneling;
to 192.168.100.4;
binding-sid 1003001;
primary {
seg1;
}
}
}
user@R1#show routing-options router-id 192.168.100.1;
验证
要确认配置工作正常,请执行以下任务:
验证基于 SR-流量工程的 LDP 隧道
目的
验证是否已启用基于 SR 流量工程的 LDP 隧道,以及通向远程边缘路由器的 LDP 隧道是否采用正确的路径。
行动
在操作模式下,运行命令 show spring-traffic-engineering lsp detail 。
在 R1 上
user@R1>show spring-traffic-engineering lsp detail Name: sr_static_r5 Tunnel-source: Static configuration To: 192.168.100.2 State: Up LDP-tunneling enabled Path: seg1 Outgoing interface: NA Auto-translate status: Enabled Auto-translate result: Success Compute Status:Disabled , Compute Result:N/A , Compute-Profile Name:N/A BFD status: N/A BFD name: N/A ERO Valid: true SR-ERO hop count: 3 Hop 1 (Strict): NAI: IPv4 Adjacency ID, 0.0.0.0 -> 10.1.4.2 SID type: 20-bit label, Value: 80104 Hop 2 (Strict): NAI: IPv4 Adjacency ID, 0.0.0.0 -> 10.1.5.2 SID type: 20-bit label, Value: 80204 Hop 3 (Strict): NAI: IPv4 Adjacency ID, 0.0.0.0 -> 10.1.6.2 SID type: 20-bit label, Value: 80304 Total displayed LSPs: 1 (Up: 1, Down: 0)
在 R2 上
user@R2>show spring-traffic-engineering lsp detail Name: sr_static_r1 Tunnel-source: Static configuration To: 192.168.100.1 State: Up LDP-tunneling enabled Path: seg1 Outgoing interface: NA Auto-translate status: Enabled Auto-translate result: Success Compute Status:Disabled , Compute Result:N/A , Compute-Profile Name:N/A BFD status: N/A BFD name: N/A ERO Valid: true SR-ERO hop count: 3 Hop 1 (Strict): NAI: IPv4 Adjacency ID, 0.0.0.0 -> 10.1.6.1 SID type: 20-bit label, Value: 80504 Hop 2 (Strict): NAI: IPv4 Adjacency ID, 0.0.0.0 -> 10.1.5.1 SID type: 20-bit label, Value: 80300 Hop 3 (Strict): NAI: IPv4 Adjacency ID, 0.0.0.0 -> 10.1.4.1 SID type: 20-bit label, Value: 80200 Total displayed LSPs: 1 (Up: 1, Down: 0)
意义
在 R1 上,LDP 隧道是通过 SR-流量工程核心网络中的远程边缘路由器 192.168.100.2 建立的。您还可以在输出中看到 SID 标签值 80104、80204、80304 。
在 R2 上,LDP 隧道通过 SR-流量工程核心网络中的远程边缘路由器 192.168.100.1 建立。您还可以在输出中看到 SID 标签值 80504、80300、80200 。
验证到远程 PE 设备的 LDP 转发
目的
验证到远程 PE 路由器的路由是否使用 LDP 转发,并通过 SR-流量工程建立隧道。
行动
在操作模式下,运行命令 show route destination-prefix 。
在 R1 上
验证到远程 PE (PE2) 路由器的路由是否通过 SR-流量工程隧道上的 LDP。
user@R1>show route 192.168.100.6
inet.0: 24 destinations, 24 routes (24 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.100.6/32 *[IS-IS/18] 5d 13:10:09, metric 20
> to 10.1.3.2 via ge-0/0/1.0
inet.3: 8 destinations, 13 routes (5 active, 0 holddown, 6 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.100.6/32 *[LDP/1] 5d 13:10:09, metric 1
> to 10.1.4.2 via ge-0/0/2.0, Push 16, Push 80304, Push 80204(top)
to 10.1.3.2 via ge-0/0/1.0, Push 16, Push 80304, Push 80204, Push 85003, Push 85004(top)
在 R2 上
验证到远程 PE (PE1) 路由器的路由是否通过 SR-流量工程隧道上的 LDP。
user@R2>show route 192.168.100.5
inet.0: 24 destinations, 24 routes (24 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.100.5/32 *[IS-IS/18] 5d 13:20:15, metric 20
> to 10.1.3.1 via ge-0/0/1.0
inet.3: 8 destinations, 13 routes (5 active, 0 holddown, 6 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.100.5/32 *[LDP/9] 5d 13:20:15, metric 1
> to 10.1.6.1 via ge-0/0/2.0, Push 16, Push 80200, Push 80300(top)
to 10.1.3.1 via ge-0/0/1.0, Push 16, Push 80200, Push 80300, Push 85004, Push 85003(top)
在 PE1 上
验证到远程 PE (PE2) 路由器的路由是否通过目标 LDP 会话到远程 PE。
user@PE1>show route 192.168.100.6
inet.0: 22 destinations, 22 routes (22 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.100.6/32 *[IS-IS/18] 1w3d 15:58:20, metric 30
> to 10.1.2.2 via ge-0/0/3.0
inet.3: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.100.6/32 *[LDP/9] 1w0d 16:00:05, metric 1
> to 10.1.2.2 via ge-0/0/3.0, Push 18
在 PE2 上
验证到远程 PE (PE1) 路由器的路由是否通过目标 LDP 会话到远程 PE。
user@PE2>show route 192.168.100.5
inet.0: 22 destinations, 22 routes (22 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.100.5/32 *[IS-IS/18] 1w3d 15:59:19, metric 30
> to 10.1.7.1 via ge-0/0/3.0
inet.3: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.100.5/32 *[LDP/9] 1w0d 16:01:14, metric 1
> to 10.1.7.1 via ge-0/0/3.0, Push 18
意义
在 R1 上,您可以看到 LDP 标签为 16,SR -流量工程标签堆栈为 80304、80204、85003、85004。
在 R2 上,您可以看到 LDP 标签为 16,SR -流量工程标签堆栈为 80200、80300、85004、85003。
在 PE1 和 PE2 上,您可以看到 LDP 标签分别为 18 和 19。
验证播发的标签
目的
验证为转发同等类 (FEC) 播发的标签。
行动
在操作模式下,运行命令 show ldp database 。
在 R1 上
验证向直连 PE (PE1) 播发的标签以及从远程边缘路由器 (R2) 接收的标签。
user@R1>show ldp database
Input label database, 192.168.100.1:0--192.168.100.2:0
Labels received: 4
Label Prefix
17 192.168.100.1/32
3 192.168.100.2/32
18 192.168.100.5/32
16 192.168.100.6/32
Output label database, 192.168.100.1:0--192.168.100.2:0
Labels advertised: 4
Label Prefix
3 192.168.100.1/32
17 192.168.100.2/32
16 192.168.100.5/32
18 192.168.100.6/32
Input label database, 192.168.100.1:0--192.168.100.5:0
Labels received: 4
Label Prefix
17 192.168.100.1/32
18 192.168.100.2/32
3 192.168.100.5/32
19 192.168.100.6/32
Output label database, 192.168.100.1:0--192.168.100.5:0
Labels advertised: 4
Label Prefix
3 192.168.100.1/32
17 192.168.100.2/32
16 192.168.100.5/32
18 192.168.100.6/32
在 R2 上
验证向直连 PE (PE2) 播发的标签以及从远程边缘路由器 (R1) 接收的标签。
user@R2>show ldp database
Input label database, 192.168.100.2:0--192.168.100.1:0
Labels received: 4
Label Prefix
3 192.168.100.1/32
17 192.168.100.2/32
16 192.168.100.5/32
18 192.168.100.6/32
Output label database, 192.168.100.2:0--192.168.100.1:0
Labels advertised: 4
Label Prefix
17 192.168.100.1/32
3 192.168.100.2/32
18 192.168.100.5/32
16 192.168.100.6/32
Input label database, 192.168.100.2:0--192.168.100.6:0
Labels received: 4
Label Prefix
18 192.168.100.1/32
17 192.168.100.2/32
19 192.168.100.5/32
3 192.168.100.6/32
Output label database, 192.168.100.2:0--192.168.100.6:0
Labels advertised: 4
Label Prefix
17 192.168.100.1/32
3 192.168.100.2/32
18 192.168.100.5/32
16 192.168.100.6/32
在 PE1 上
验证边缘设备 R1 是否向本地 PE (PE1) 设备播发了远程 PE (PE2) 设备环路地址的标签。
user@PE1>show ldp database
Input label database, 192.168.100.5:0--192.168.100.1:0
Labels received: 4
Label Prefix
3 192.168.100.1/32
17 192.168.100.2/32
16 192.168.100.5/32
18 192.168.100.6/32
Output label database, 192.168.100.5:0--192.168.100.1:0
Labels advertised: 4
Label Prefix
17 192.168.100.1/32
18 192.168.100.2/32
3 192.168.100.5/32
19 192.168.100.6/32
在 PE2 上
验证边缘设备 R2 是否向本地 PE (PE2) 设备播发了远程 PE (PE1) 设备环路地址的标签。
user@PE2>show ldp database
Input label database, 192.168.100.6:0--192.168.100.2:0
Labels received: 4
Label Prefix
17 192.168.100.1/32
3 192.168.100.2/32
18 192.168.100.5/32
16 192.168.100.6/32
Output label database, 192.168.100.6:0--192.168.100.2:0
Labels advertised: 4
Label Prefix
18 192.168.100.1/32
17 192.168.100.2/32
19 192.168.100.5/32
3 192.168.100.6/32
意义
在 R1 上,您可以看到标签 18 已向直连的 PE (PE1) 播发,标签 19 是从远程边缘路由器 (R2) 接收的。
在 R2 上,您可以看到标签 17 是向直连的 PE (PE2) 播发的,标签 19 是从远程边缘路由器 (R1) 接收的。
在 PE1 上,您可以看到从本地边缘路由器 (R1) 接收了标签 18 。
在 PE2 上,您可以看到标签 17 是从本地边缘路由器 (R2) 接收的。
标签操作
图 5 描述了通过 RSVP LSP 建立隧道的 LDP LSP。(有关标签操作的定义,请参阅 MPLS 标签概述。)阴影内椭圆形代表 RSVP 结构域,而外部椭圆形表示 LDP 结构域。RSVP 通过路由器 B、C、D 和 E 建立 LSP,标签序列为 L3、L4。LDP 通过路由器 A、B、E、F 和 G 建立 LSP,标签序列为 L1、L2、L5。LDP 将路由器 B 和 E 之间的 RSVP LSP 视为单跃点。
当数据包到达路由器 A 时,它进入 LDP 建立的 LSP,并将标签 (L1) 推送到数据包上。当数据包到达路由器 B 时,标签 (L1) 将与其他标签 (L2) 交换。由于数据包正在进入 RSVP 建立的流量工程 LSP,因此第二个标签 (L3) 会被推送到数据包上。
此外部标签 (L3) 在 RSVP LSP 隧道内的中间路由器 (C) 上与新标签 (L4) 交换,当到达倒数第二个路由器 (D) 时,将弹出顶部标签。路由器 E 将标签 (L2) 与新标签 (L5) 交换,LDP 建立的 LSP (F) 的倒数第二个路由器弹出最后一个标签。
建立隧道时,交换和推送
图 6 描述了双推标签操作 (L1L2)。当 LDP LSP 和通过其隧道传输的 RSVP LSP 的入口路由器 (A) 是同一设备时,使用双推标签操作。请注意,路由器 D 是 LDP 建立的 LSP 的倒数第二个跃点,因此路由器 D 会从数据包中弹出 L2。
LDP 会话保护
LDP 会话保护基于 RFC 5036 LDP 规范中定义的 LDP 定向 hello 功能,受 Junos OS 以及大多数其他供应商的 LDP 实施支持。它涉及将单播用户数据报协议 (UDP) hello 数据包发送到远程邻居地址,以及从邻居路由器接收类似的数据包。
如果在路由器上配置 LDP 会话保护,则 LDP 会话将按如下方式维护:
LDP 会话将在路由器与远程相邻路由器之间建立。
如果路由器之间的所有直接链路都中断,只要路由器之间基于网络上的另一个连接存在 IP 连接,LDP 会话就会保持开启状态。
重新建立路由器之间的直接链路时,LDP 会话不会重新启动。路由器之间仅通过直接链路相互交换 LDP hello。然后,他们就可以开始使用原始 LDP 会话转发 LDP 信号 MPLS 数据包。
默认情况下,只要 LDP 会话处于开启状态,LDP 目标 hello 就会设置为远程邻接方,即使该路由器不再有链路邻接方也是如此。您还可以指定在没有链路邻接方的情况下保持远程邻接方连接的持续时间。当会话的最后一个链路邻接方关闭时,Junos OS 将启动 LDP 会话保护计时器。如果此计时器在任何链路邻接方恢复之前到期,则远程邻接方连接将被断开,LDP 会话将终止。如果在计时器当前运行时为其配置不同的值,则 Junos OS 会将计时器更新为指定值,而不会中断 LDP 会话的当前状态。
LDP 原生 IPv6 支持概述
IPv6 连接通常依赖于通过 IPv4 MPLS 核心和 IPv4 信号 MPLS 标签交换路径 (LSP) 的 MPLS 隧道 IPv6。这需要由 IPv6 提供商边缘路由器静态配置或动态建立 IPv4 信号 LSP。由于 IPv6 的需求不断增长,因此必须部署带有 IPv6 信号 LSP 的 IPv6 MPLS 核心,以提供 IPv6 连接。在 Junos OS 中,LDP 仅在 IPv6 网络和 IPv6/IPv4 双堆栈网络中受支持,如 RFC 7552 中所述。除了为 IPv4 和 IPv6 网络提供单个会话外,Junos OS LDP 还支持仅针对 IPv4 的单独 IPv4 会话,以及仅支持 IPv6 的 IPv6 会话。
您可以为 IPv4 或 inet6 IPv6 配置inet地址族,或同时配置两者。如果未配置家族地址,则启用 family inet 的默认地址。同时配置了 IPv4 和 IPv6 时,您可以使用该transport-preference语句将首选传输配置为 IPv4 IPv6或 。根据优先级,LDP 会尝试使用 IPv4 或 IPv6 建立 TCP 连接。默认情况下,IPv6 处于选中状态。该dual-transport语句允许 Junos OS LDP 通过 IPv4 与 IPv4 邻接方建立 TCP 连接,并通过 IPv6 与 IPv6 邻接方建立 TCP 连接,作为单堆栈标签交换路由器。inet-lsr-id和 inet6-lsr-id ID 是两个标签交换路由器 ID,必须配置它们才能通过 IPv4 和 IPv6 TCP 传输建立 LDP 会话。这两个 ID 应为非零,并且必须配置不同的值。
LDP 的最长匹配支持概述
LDP 通常用于使用 OSPF 或 IS-IS 等 IGP 在整个网域中建立 MPLS 标签交换路径 (LSP)。在此类网络中,域中的所有链路都具有 IGP 邻接和 LDP 邻接。LDP 在到 IGP 确定的目标的最短路径上建立 LSP。在 Junos OS 中,LDP 实施会对路由信息库 (RIB) 或 IGP 路由中转发同等类 (FEC) 的 IP 地址进行精确匹配查找,以进行标签映射。这种精确的映射需要在所有标签边缘路由器 (LER) 中配置 MPLS 端到端 LDP 端点 IP 地址。这违背了接入设备中 IP 分层设计或默认路由的目的。配置允许 longest-match LDP 根据域间 OSPF 区域或 IS-IS 级别聚合或汇总的路由设置 LSP。
变更历史表
是否支持某项功能取决于您使用的平台和版本。使用 功能资源管理器 确定您的平台是否支持某个功能。