MPLS 的共享风险链路组
SRLG 概述
在 MPLS 流量工程中,共享风险链路组 (SRLG) 是共享公共资源的一组链路,在通用资源发生故障时会影响集内的所有链路。这些链路具有相同的故障风险,因此被视为属于同一 SRLG。例如,共享通用光纤的链路据说在同一 SRLG 中,因为光纤故障可能导致组中的所有链路发生故障。
SRLG 由 IGP(OSPFv2 和 IS-IS) 域中唯一的 32 位数字表示。链路可能属于多个 SRLG。标签交换系列 (LSP) 中的路径 SRLG 是路径中所有链路的一组 SRLG。计算 LSP 的辅助路径时,最好找到路径,以便在主路径和辅助路径的 SRLG 脱节时,辅助路径和主路径没有任何通用链路。这样可确保特定链路上的单点故障不会降低 LSP 中的主路径和辅助路径。
配置 SRLG 时,设备将使用受限最短路径优先 (CSPF) 算法,并尝试将用于主路径和辅助路径的链路相互排他。如果主路径下降,CSPF 算法将尝试避免与主路径共享任何 SRLG 的链路,从而计算辅助路径。此外,在计算绕过 LSP 的路径时,CSPF 会尝试避免与受保护链路共享任何 SRLG 的链路。
未配置 SRLG 时,CSPF 仅在计算辅助路径时考虑链路的成本。
链路 SRLG 信息的任何更改都会触发 IGP,以发送有关新链路 SRLG 信息的 LSP 更新。CSPF 在下一轮重新优化期间重新计算路径。
Junos OS 版本 11.4 和更高版本支持基于以下 RFC 的 SRLG:
RFC 4203, 支持通用多协议标签交换 (GMPLS) 的 OSPF 扩展。
RFC 5307, 支持通用多协议标签交换 (GMPLS) 的 IS-IS 扩展。
目前,“命运共享”功能继续受 SRLG 功能支持。
示例:配置 SRLG
此示例说明如何在设备上配置共享风险链路组 (SRLG)。
要求
此示例使用以下硬件和软件组件:
七个可组合使用 M 系列、MX 系列或 T 系列路由器的路由器
所有设备上运行的 Junos OS 版本 11.4 或更高版本
概述
Junos OS 版本 11.4 和更高版本支持 IGP(OSPFv2 和 IS-IS) 域中的 SRLG 配置。在此示例中,您可配置 SRLG 并将其与设备上的 MPLS 接口相关联。
设备使用受限最短路径优先 (CSPF) 算法的 SRLG 成本参数,并尝试通过避免与主路径共享任何 SRLG 的链路来保持用于主路径和辅助路径的链路相互排他。
要配置 SRLG,首先在 [edit routing-options srlg srlg-name]
层次结构级别定义 SRLG 参数,然后将 SRLG 与层级的 [edit mpls interface interface-name]
MPLS 接口相关联。
该 srlg srlg-name
语句具有以下选项:
srlg-cost
— 包括 1 到 65535 不等的 SRLG 成本。SRLG 的成本决定了此 SRLG 对路径计算的 CSPF 算法的影响级别。成本越高,辅助路径共享与主路径相同的 SRLG 的可能性就越小。默认情况下,srlg-cost
为 1。srlg-value
— 包括 SRLG 的组 ID,范围为 1 到 4294967295。
在此示例中:
PE1 是入口路由器,而 PE2 是出口路由器。
P1、P2 和 P3、P4 和 P5 是传输路由器。
P1 与 PE1 入口和 PE2 出口路由器都有直接主路径连接。
P2 具有与 PE1 和 PE2 的直接辅助路径连接。
P3 具有与 PE1 的直接辅助路径连接,以及通过 P4 和 P5 到 PE2 的间接辅助路径。
P4 具有到 PE1 到 P3 和 PE2 到 P5 的间接辅助路径。
P5 具有通过 P4 和 P3 到 PE1 的间接路径,以及通往 PE2 的直接辅助路径。
OSPF 配置在所有路由器上作为内部网关协议 (IGP)。SRLG 配置在所有七个路由器上。主路径包括 SRLG srlg-a
。对于备用辅助路径,链路 P2>PE2 属于 SRLG srlg-a
。将添加 srlg-cost
10 的高效链路指标变为 11。因此,计算的辅助路径是 PE1>P3>P4>P5>PE2,CSPF 链路指标为 4。
拓扑

配置
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,移除任何换行符,更改与网络配置匹配所需的任何详细信息,然后将命令复制粘贴到层次结构级别的 [edit]
CLI 中。
路由器 PE1
set interfaces ge-0/0/1 unit 0 family inet address 192.168.12.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.13.1/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.14.1/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.1/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.0 set protocols mpls optimize-timer 120 set protocols mpls label-switched-path pe1-pe2 to 10.255.0.7 set protocols mpls label-switched-path pe1-pe2 primary via-p1 set protocols mpls label-switched-path pe1-pe2 secondary path2 standby set protocols mpls path via-p1 10.255.0.2 strict set protocols mpls path path2 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 ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
路由器 P1
set interfaces ge-0/0/1 unit 0 family inet address 192.168.12.2/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.27.2/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.2/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 srlg srlg-a set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 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
路由器 P2
set interfaces ge-0/0/1 unit 0 family inet address 192.168.13.3/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.37.3/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.3/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 srlg srlg-a set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 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
路由器 P3
set interfaces ge-0/0/1 unit 0 family inet address 192.168.14.4/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.45.4/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.4/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 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
路由器 P4
set interfaces ge-0/0/1 unit 0 family inet address 192.168.45.5/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.56.5/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.5/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 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
路由器 P5
set interfaces ge-0/0/1 unit 0 family inet address 192.168.56.6/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.67.6/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.6/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 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
路由器 PE2
set interfaces ge-0/0/1 unit 0 family inet address 192.168.27.7/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.37.7/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.67.7/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.7/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.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 ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
程序
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置入口路由器 PE1:
配置设备接口。
[edit interfaces]
user@PE1# set ge-0/0/1 unit 0 family inet address 192.168.12.1/24 user@PE1# set ge-0/0/1 unit 0 family mpls user@PE1# set ge-0/0/2 unit 0 family inet address 192.168.13.1/24 user@PE1# set ge-0/0/2 unit 0 family mpls user@PE1# set ge-0/0/3 unit 0 family inet address 192.168.14.1/24 user@PE1# set ge-0/0/3 unit 0 family mpls user@PE1# set lo0 unit 0 family inet address 10.255.0.1/32在接口上配置 OSPF。
[edit protocols ospf]
user@PE1# set traffic-engineering user@PE1# set area 0.0.0.0 interface ge-0/0/1.0 user@PE1# set area 0.0.0.0 interface ge-0/0/2.0 user@PE1# set area 0.0.0.0 interface ge-0/0/3.0 user@PE1# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@PE1# set srlg srlg-a srlg-value 101 user@PE1# set srlg srlg-a srlg-cost 10配置 MPLS 和 LSP。
[edit protocols mpls]
user@PE1# set interface ge-0/0/1.0 user@PE1# set interface ge-0/0/2.0 user@PE1# set interface ge-0/0/3.0 user@PE1# set optimize-timer 120 user@PE1# set label-switched-path pe1-pe2 to 10.255.0.7 user@PE1# set label-switched-path pe1-pe2 primary via-p1 user@PE1# set label-switched-path pe1-pe2 secondary path2 standby user@PE1# set path via-p1 10.255.0.2 strict user@PE1# set path path2在接口上启用 RSVP。
[edit protocols rsvp]
user@PE1# set interface ge-0/0/1.0 user@PE1# set interface ge-0/0/2.0 user@PE1# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces
、 show protocols ospf
、 show routing-options
、 show protocols mpls
和 show protocols rsvp
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@PE1# show interfaces interfaces { ge-0/0/1 { unit 0 { family inet { address 192.168.12.1/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.13.1/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.14.1/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.1/32; } } } }
user@PE1# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0;; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@PE1# show protocols mpls optimize-timer 120; label-switched-path pe1-pe2 { to 10.255.0.7; primary via-p1; secondary path2 { standby; } } path via-p1 { 10.255.0.2 strict; } path path2; interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE1# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE1# show routing-options routing-options { srlg { srlg-a { srlg-value 101; srlg-cost 10; } } }
如果完成设备配置,请在配置模式下输入 commit 。
修改每个路由器的相应接口名称、地址和任何其他参数之后,对 IGP 域中的每台瞻博网络路由器重复此过程。
验证
确认配置工作正常。
验证 TE 链路 SRLG
目的
验证信息流工程链路 SRLG 关联。
行动
user@PE1> show ted link detail ... 10.255.0.2->192.168.27.7-1, Local: 192.168.27.2, Remote: 0.0.0.0 Local interface index: 0, Remote interface index: 0 LocalPath: 1, Metric: 1, StaticBW: 1000Mbps, AvailBW: 1000Mbps Color: 0 <none> SRLGs: srlg-a localBW [0] 0bps [1] 0bps [2] 0bps [3] 0bps localBW [4] 0bps [5] 0bps [6] 0bps [7] 0bps ... 10.255.0.3->192.168.37.7-1, Local: 192.168.37.3, Remote: 0.0.0.0 Local interface index: 0, Remote interface index: 0 LocalPath: 0, Metric: 1, StaticBW: 1000Mbps, AvailBW: 1000Mbps Color: 0 <none> SRLGs: srlg-a localBW [0] 0bps [1] 0bps [2] 0bps [3] 0bps localBW [4] 0bps [5] 0bps [6] 0bps [7] 0bps ...
意义
链路 P1-PE2 和 P2-PE2 与 SRLG srlg-a
相关联。
验证备用辅助路径
目的
检查 SRLG 链路成本及其对备用辅助路径链路的 CSPF 计算的影响。
行动
user@PE1> show mpls lsp ingress extensive Ingress LSP: 1 sessions 10.255.0.7 From: 10.255.0.1, State: Up, ActiveRoute: 0, LSPname: pe1-pe2 ActivePath: via-p1 (primary) LSPtype: Static Configured LoadBalance: Random Encoding type: Packet, Switching type: Packet, GPID: IPv4 *Primary via-p1 State: Up Priorities: 7 0 OptimizeTimer: 120 SmartOptimizeTimer: 180 SRLG: srlg-a Reoptimization in 110 second(s). Computed ERO (S [L] denotes strict [loose] hops): (CSPF metric: 2) 192.168.12.2 S 192.168.27.7 S Received RRO (ProtectionFlag 1=Available 2=InUse 4=B/W 8=Node 10=SoftPreempt 20=Node-ID): 192.168.12.2 192.168.27.7 7 Oct 13 15:17:11.310 CSPF: computation result ignored, new path no benefit 6 Oct 13 15:15:14.959 Selected as active path 5 Oct 13 15:15:14.958 Record Route: 192.168.12.2 192.168.27.7 4 Oct 13 15:15:14.954 Up 3 Oct 13 15:15:14.793 Originate Call 2 Oct 13 15:15:14.793 CSPF: computation result accepted 192.168.12.2 192.168.27.7 1 Oct 13 15:14:46.214 CSPF failed: no route toward 10.255.0.2 Standby path2 State: Up Priorities: 7 0 OptimizeTimer: 120 SmartOptimizeTimer: 180 Reoptimization in 115 second(s). Computed ERO (S [L] denotes strict [loose] hops): (CSPF metric: 4) 192.168.14.4 S 192.168.45.5 S 192.168.56.6 S 192.168.67.7 S Received RRO (ProtectionFlag 1=Available 2=InUse 4=B/W 8=Node 10=SoftPreempt 20=Node-ID): 192.168.14.4 192.168.45.5 192.168.56.6 192.168.67.7 10 Oct 13 15:17:11.929 Record Route: 192.168.14.4 192.168.45.5 192.168.56.6 192.168.67.7 9 Oct 13 15:17:11.929 Up 8 Oct 13 15:17:11.729 Originate Call 7 Oct 13 15:17:11.729 Clear Call 6 Oct 13 15:17:11.729 CSPF: computation result accepted 192.168.14.4 192.168.45.5 192.168.56.6 192.168.67.7 5 Oct 13 15:17:11.729 CSPF: Reroute due to re-optimization 4 Oct 13 15:15:14.984 Record Route: 192.168.13.3 192.168.37.7 3 Oct 13 15:15:14.984 Up 2 Oct 13 15:15:14.830 Originate Call 1 Oct 13 15:15:14.830 CSPF: computation result accepted 192.168.13.3 192.168.37.7 Created: Thu Oct 13 15:13:46 2011 Total 1 displayed, Up 1, Down 0
意义
检查备用辅助路径。P2>PE2 的有效链路成本为 11(添加 srlg-cost
10)。CSPF 将辅助路径计算为 PE1>P3>P4>P5>PE2,CSPF 链路指标为 4。
示例:完全排除辅助 LSP 的 SRLG 链路
此示例说明如何配置 exclude-srlg
排除辅助标签交换系列 (LSP) 的共享风险链路组 (SRLG) 链路的选项。
要求
此示例使用以下硬件和软件组件:
M 系列、MX 系列或 T 系列设备
所有设备上运行的 Junos OS 版本 11.4 或更高版本
概述
对于必须保持辅助路径和主路径与任何通用 SRLG 完全脱节的关键链路,您可以选择在[edit protocols mpls]
或[edit protocols mpls label-switched-path path-name]
层级配置exclude-srlg
语句。对于逻辑系统,您可在edit logical-systems protocols mpls
[edit logical-systems logical-system-name protocols mpls label-switched-path path-name]
层次结构级别配置exclude-srlg
语句。
如果 exclude-srlg
配置了受限最短路径优先 (CSPF) 算法,则排除主路径中属于 SRLG 集的任何链路。如果 exclude-srlg
未配置,并且链路属于主路径中的 SRLG 集,CSPF 会将 SRLG 成本添加到指标中,但仍接受计算路径的链路。
在此示例中,PE1 是入口路由器,而 PE2 是出口路由器。P1、P2 和 P3、P4 和 P5 是传输路由器。OSPF 配置在所有路由器上作为内部网关协议 (IGP)。SRLG 配置在所有七个路由器上。主路径包括 SRLG srlg-a
。对于备用辅助路径,链路 P2>PE2 属于 SRLG srlg-a
。由于 exclude-srlg
已配置,CSPF 拒绝链路 P2>PE2,因为链路属于 SRLG srlg-a
。因此,计算备用辅助路径是 PE1>P3>P4>P5>PE2。
拓扑

配置
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,移除任何换行符,更改与网络配置匹配所需的任何详细信息,然后将命令复制粘贴到层次结构级别的 [edit]
CLI 中。
路由器 PE1
set interfaces ge-0/0/1 unit 0 family inet address 192.168.12.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.13.1/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.14.1/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.1/32 set routing-options srlg srlg-a srlg-value 101 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.0 set protocols mpls optimize-timer 120 set protocols mpls exclude-srlg set protocols mpls label-switched-path pe1-pe2 to 10.255.0.7 set protocols mpls label-switched-path pe1-pe2 primary via-p1 set protocols mpls label-switched-path pe1-pe2 secondary path2 standby set protocols mpls path via-p1 10.255.0.2 strict set protocols mpls path path2 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 ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
程序
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
配置设备接口。
[edit interfaces]
user@PE1# set ge-0/0/1 unit 0 family inet address 192.168.12.1/24 user@PE1# set ge-0/0/1 unit 0 family mpls user@PE1# set ge-0/0/2 unit 0 family inet address 192.168.13.1/24 user@PE1# set ge-0/0/2 unit 0 family mpls user@PE1# set ge-0/0/3 unit 0 family inet address 192.168.14.1/24 user@PE1# set ge-0/0/3 unit 0 family mpls user@PE1# set lo0 unit 0 family inet address 10.255.0.1/32在接口上配置 OSPF。
[edit protocols ospf]
user@PE1# set traffic-engineering user@PE1# set area 0.0.0.0 interface ge-0/0/1.0 user@PE1# set area 0.0.0.0 interface ge-0/0/2.0 user@PE1# set area 0.0.0.0 interface ge-0/0/3.0 user@PE1# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@PE1# set routing-options srlg srlg-a srlg-value 101配置 MPLS 和 LSP。
[edit protocols mpls]
user@PE1# set interface ge-0/0/1.0 user@PE1# set interface ge-0/0/2.0 user@PE1# set interface ge-0/0/3.0 user@PE1# set optimize-timer 120 user@PE1# set exclude-srlg user@PE1# set label-switched-path pe1-pe2 to 10.255.0.7 user@PE1# set label-switched-path pe1-pe2 primary via-p1 user@PE1# set label-switched-path pe1-pe2 secondary path2 standby user@PE1# set path via-p1 10.255.0.2 strict user@PE1# set path path2配置语句以
exclude-srlg
强制保持辅助路径的链路与主 LSP 路径完全脱节。user@PE1 set protocols mpls exclude-srlg
在接口上启用 RSVP。
[edit protocols rsvp]
user@PE1# set interface ge-0/0/1.0 user@PE1# set interface ge-0/0/2.0 user@PE1# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show routing-options
、 show protocols mpls
和 show protocols rsvp
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@PE1# show interfaces interfaces { ge-0/0/1 { unit 0 { family inet { address 192.168.12.1/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.13.1/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.14.1/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.1/32; } } } }
user@PE1# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0;; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@PE1# show protocols mpls optimize-timer 120; label-switched-path pe1-pe2 { to 10.255.0.7; primary via-p1; secondary path2 { standby; } } path via-p1 { 10.255.0.2 strict; } path path2; interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE1# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE1# show routing-options routing-options { srlg { srlg-a srlg-value 101; } }
如果完成设备配置,请在配置模式下输入 commit 。
修改每个路由器的相应接口名称、地址和任何其他参数之后,对 IGP 域中的每台瞻博网络路由器重复此过程。
验证
确认配置工作正常。
验证 LSP 的辅助路径链路
目的
验证辅助路径的链路是否与主路径完全脱节。
行动
user@PE1> show mpls lsp detail Ingress LSP: 1 sessions 10.255.0.7 From: 10.255.0.1, State: Up, ActiveRoute: 0, LSPname: pe1-pe2 ActivePath: via-p1 (primary) LSPtype: Static Configured LoadBalance: Random Encoding type: Packet, Switching type: Packet, GPID: IPv4 *Primary via-p1 State: Up Priorities: 7 0 OptimizeTimer: 120 SmartOptimizeTimer: 180 SRLG: srlg-a Reoptimization in 77 second(s). Computed ERO (S [L] denotes strict [loose] hops): (CSPF metric: 2) 192.168.12.2 S 192.168.27.7 S Received RRO (ProtectionFlag 1=Available 2=InUse 4=B/W 8=Node 10=SoftPreempt 20=Node-ID): 192.168.12.2 192.168.27.7 Standby path2 State: Up Priorities: 7 0 OptimizeTimer: 120 SmartOptimizeTimer: 180 Reoptimization in 106 second(s). Computed ERO (S [L] denotes strict [loose] hops): (CSPF metric: 4) 192.168.14.4 S 192.168.45.5 S 192.168.56.6 S 192.168.67.7 S Received RRO (ProtectionFlag 1=Available 2=InUse 4=B/W 8=Node 10=SoftPreempt 20=Node-ID): 192.168.14.4 192.168.45.5 192.168.56.6 192.168.67.7 Total 1 displayed, Up 1, Down 0 Link P1->PE2: SRLG srlg-a Link P2->PE2: SRLG srlg-a Primary path: PE1-P1-PE2 (CSPF metric: 2) Standby secondary: PE1-P3-P4-P5-PE2 (CSPF metric: 4)
意义
主路径包括 SRLG srlg-a
。对于备用辅助路径,链路 P2>PE2 属于 SRLG srlg-a
。CSPF 拒绝链路 P2>PE2,因为链路属于 SRLG srlg-a
。
示例:使用链路保护配置 SRLG
此示例说明如何在没有选项的情况下 exclude-srlg
使用链路保护配置 SRLG。
要求
此示例使用以下硬件和软件组件:
M 系列、MX 系列或 T 系列设备
所有设备上运行的 Junos OS 版本 11.4 或更高版本
概述
在此示例中,PE1 是入口路由器,而 PE2 是出口路由器。P1、P2 和 P3、P4 和 P5 是传输路由器。OSPF 配置在所有路由器上作为内部网关协议 (IGP)。SRLG 配置在所有七个路由器上。链路 P1>PE2(主路径)和链路 P2>PE2 属于 SRLG srlg-a。
通过包括 link-protection
语句,可为接口 P1>PE2 配置链路保护。
当在链路 P1>PE2 和 P2>PE2 上配置 SRLG srlg-a 时,旁路将采用更长的路径 P1>P4>P5>PE2,而不是选择链路 P2>PE2,因为 srlg-a 增加了 SRLG 成本。
拓扑

配置
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,移除任何换行符,更改与网络配置匹配所需的任何详细信息,然后将命令复制粘贴到层次结构级别的 [edit]
CLI 中。
路由器 PE1
set interfaces ge-0/0/1 unit 0 family inet address 192.168.12.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.13.1/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.14.1/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.1/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.0 set protocols mpls optimize-timer 120 set protocols mpls label-switched-path pe1-pe2 to 10.255.0.7 set protocols mpls label-switched-path pe1-pe2 link-protection set protocols mpls label-switched-path pe1-pe2 primary via-p1 set protocols mpls label-switched-path pe1-pe2 secondary path2 standby set protocols mpls path via-p1 10.255.0.2 strict set protocols mpls path path2 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 ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
路由器 P1
set interfaces ge-0/0/1 unit 0 family inet address 192.168.12.2/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.27.2/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.23.2/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces ge-0/0/4 unit 0 family inet address 192.168.25.2/24 set interfaces ge-0/0/4 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.2/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 link-protection set protocols rsvp interface ge-0/0/3.0 set protocols rsvp interface ge-0/0/4.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 srlg srlg-a set protocols mpls interface ge-0/0/3.0 set protocols mpls interface ge-0/0/4.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface ge-0/0/4.0 set protocols ospf area 0.0.0.0 interface lo0.0
路由器 P2
set interfaces ge-0/0/1 unit 0 family inet address 192.168.13.3/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.37.3/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.23.3/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.3/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 srlg srlg-a set protocols mpls interface ge-0/0/3.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
路由器 P3
set interfaces ge-0/0/1 unit 0 family inet address 192.168.14.4/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.45.4/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.4/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 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
路由器 P4
set interfaces ge-0/0/1 unit 0 family inet address 192.168.45.5/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.56.5/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.25.5/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.5/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.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 ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
路由器 P5
set interfaces ge-0/0/1 unit 0 family inet address 192.168.56.6/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.67.6/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.6/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 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
路由器 PE2
set interfaces ge-0/0/1 unit 0 family inet address 192.168.27.7/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.37.7/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.67.7/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.7/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.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 ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
配置设备 PE1
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置入口路由器 PE1:
配置设备接口。
[edit interfaces]
user@PE1# set ge-0/0/1 unit 0 family inet address 192.168.12.1/24 user@PE1# set ge-0/0/1 unit 0 family mpls user@PE1# set ge-0/0/2 unit 0 family inet address 192.168.13.1/24 user@PE1# set ge-0/0/2 unit 0 family mpls user@PE1# set ge-0/0/3 unit 0 family inet address 192.168.14.1/24 user@PE1# set ge-0/0/3 unit 0 family mpls user@PE1# set lo0 unit 0 family inet address 10.255.0.1/32在接口上配置 OSPF。
[edit protocols ospf]
user@PE1# set traffic-engineering user@PE1# set area 0.0.0.0 interface ge-0/0/1.0 user@PE1# set area 0.0.0.0 interface ge-0/0/2.0 user@PE1# set area 0.0.0.0 interface ge-0/0/3.0 user@PE1# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@PE1# set srlg srlg-a srlg-value 101 user@PE1# set srlg srlg-a srlg-cost 10配置 MPLS 和 LSP 并为 LSP 配置链路保护
pe1-pe2
。[edit protocols mpls]
user@PE1# set interface ge-0/0/1.0 user@PE1# set interface ge-0/0/2.0 user@PE1# set interface ge-0/0/3.0 user@PE1# set optimize-timer 120 user@PE1# set label-switched-path pe1-pe2 to 10.255.0.7 user@PE1# set protocols mpls label-switched-path pe1-pe2 link-protection user@PE1# set label-switched-path pe1-pe2 primary via-p1 user@PE1# set label-switched-path pe1-pe2 secondary path2 standby user@PE1# set path via-p1 10.255.0.2 strict user@PE1# set path path2在接口上启用 RSVP。
[edit protocols rsvp]
user@PE1# set interface ge-0/0/1.0 user@PE1# set interface ge-0/0/2.0 user@PE1# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show routing-options
、 show protocols mpls
和 show protocols rsvp
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@PE1# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.12.1/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.13.1/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.14.1/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.1/32; } } } }
user@PE1# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@PE1# show protocols mpls optimize-timer 120; label-switched-path pe1-pe2 { to 10.255.0.7; link-protection; primary via-p1; secondary path2 { standby; } } path via-p1 { 10.255.0.2 strict; } path path2; interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE1# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE1# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 P1
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置设备 P1:
配置设备接口。
[edit interfaces]
user@P1# set ge-0/0/1 unit 0 family inet address 192.168.12.2/24 user@P1# set ge-0/0/1 unit 0 family mpls user@P1# set ge-0/0/2 unit 0 family inet address 192.168.27.2/24 user@P1# set ge-0/0/2 unit 0 family mpls user@P1# set ge-0/0/3 unit 0 family inet address 192.168.23.2/24 user@P1# set ge-0/0/3 unit 0 family mpls user@P1# set ge-0/0/4 unit 0 family inet address 192.168.25.2/24 user@P1# set ge-0/0/4 unit 0 family mpls user@P1# set lo0 unit 0 family inet address 10.255.0.2/32在接口上配置 OSPF。
[edit protocols ospf]
user@P1# set traffic-engineering user@P1# set area 0.0.0.0 interface ge-0/0/1.0 user@P1# set area 0.0.0.0 interface ge-0/0/2.0 user@P1# set area 0.0.0.0 interface ge-0/0/3.0 user@P1# set area 0.0.0.0 interface ge-0/0/4.0 user@P1# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P1# set srlg srlg-a srlg-value 101 user@P1# set srlg srlg-a srlg-cost 10在接口上配置 MPLS 并将 SRLG
srlg-a
与 P1>PE2 链路的接口 ge-0/0/2.0 相关联。[edit protocols mpls]
user@P1# set interface ge-0/0/1.0 user@P1# set interface ge-0/0/2.0 srlg srlg-a user@P1# set interface ge-0/0/3.0 user@P1# set interface ge-0/0/4.0在接口上启用 RSVP 并
link-protection
配置接口ge-0/0/2.0
。[edit protocols rsvp]
user@P1# set interface ge-0/0/1.0 user@P1# set interface ge-0/0/2.0 link-protection user@P1# set interface ge-0/0/3.0 user@P1# set interface ge-0/0/4.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P1# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.12.2/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.27.2/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.23.2/24; } family mpls; } } ge-0/0/4 { unit 0 { family inet { address 192.168.25.2/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.2/32; } } }
user@P1# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface ge-0/0/4.0; interface lo0.0; }
user@P1# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0 { srlg srlg-a; } interface ge-0/0/3.0; interface ge-0/0/4.0;
user@P1# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0 { link-protection; } interface ge-0/0/3.0; interface ge-0/0/4.0;
user@P1# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 P2
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 P2:
配置设备接口。
[edit interfaces]
user@P2# set ge-0/0/1 unit 0 family inet address 192.168.13.3/24 user@P2# set ge-0/0/1 unit 0 family mpls user@P2# set ge-0/0/2 unit 0 family inet address 192.168.37.3/24 user@P2# set ge-0/0/2 unit 0 family mpls user@P2# set ge-0/0/3 unit 0 family inet address 192.168.23.3/24 user@P2# set ge-0/0/3 unit 0 family mpls user@P2# set lo0 unit 0 family inet address 10.255.0.3/32在接口上配置 OSPF。
[edit protocols ospf]
user@P2# set traffic-engineering user@P2# set area 0.0.0.0 interface ge-0/0/1.0 user@P2# set area 0.0.0.0 interface ge-0/0/2.0 user@P2# set area 0.0.0.0 interface ge-0/0/3.0 user@P2# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P2# set srlg srlg-a srlg-value 101 user@P2# set srlg srlg-a srlg-cost 10在接口上配置 MPLS 并将 SRLG
srlg-a
与 P2>PE2 链路的接口 ge-0/0/2.0 相关联。[edit protocols mpls]
user@P2# set interface ge-0/0/1.0 user@P2# set interface ge-0/0/2.0 srlg srlg-a user@P2# set interface ge-0/0/3.0在接口上启用 RSVP。
[edit protocols rsvp]
user@P2# set interface ge-0/0/1.0 user@P2# set interface ge-0/0/2.0 user@P2# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P2# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.13.3/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.37.3/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.23.3/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.3/32; } } } }
user@P2# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@P2# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0 { srlg srlg-a; } interface ge-0/0/3.0; }
user@P2# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@P2# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 P3
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 P3:
配置设备接口。
[edit interfaces]
user@P3# set ge-0/0/1 unit 0 family inet address 192.168.14.4/24 user@P3# set ge-0/0/1 unit 0 family mpls user@P3# set ge-0/0/2 unit 0 family inet address 192.168.45.4/24 user@P3# set ge-0/0/2 unit 0 family mpls user@P3# set lo0 unit 0 family inet address 10.255.0.4/32在接口上配置 OSPF。
[edit protocols ospf]
user@P3# set traffic-engineering user@P3# set area 0.0.0.0 interface ge-0/0/1.0 user@P3# set area 0.0.0.0 interface ge-0/0/2.0 user@P3# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P3# set srlg srlg-a srlg-value 101 user@P3# set srlg srlg-a srlg-cost 10在接口上配置 MPLS。
[edit protocols mpls]
user@P3# set interface ge-0/0/1.0 user@P3# set interface ge-0/0/2.0在接口上启用 RSVP。
[edit protocols rsvp]
user@P3# set interface ge-0/0/1.0 user@P3# set interface ge-0/0/2.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P3# show interfaces interfaces { ge-0/0/1 { unit 0 { family inet { address 192.168.14.4/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.45.4/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.4/32; } } } }
user@P3# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface lo0.0; }
user@P3# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0;
user@P3# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0;
user@P3# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 P4
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 P4:
配置设备接口。
[edit interfaces]
user@P4# set ge-0/0/1 unit 0 family inet address 192.168.45.5/24 user@P4# set ge-0/0/1 unit 0 family mpls user@P4# set ge-0/0/2 unit 0 family inet address 192.168.56.5/24 user@P4# set ge-0/0/2 unit 0 family mpls user@P4# set ge-0/0/3 unit 0 family inet address 192.168.25.5/24 user@P4# set ge-0/0/3 unit 0 family mpls user@P4# set lo0 unit 0 family inet address 10.255.0.5/32在接口上配置 OSPF。
[edit protocols ospf]
user@P4# set traffic-engineering user@P4# set area 0.0.0.0 interface ge-0/0/1.0 user@P4# set area 0.0.0.0 interface ge-0/0/2.0 user@P4# set area 0.0.0.0 interface ge-0/0/3.0 user@P4# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P4# set srlg srlg-a srlg-value 101 user@P4# set srlg srlg-a srlg-cost 10在接口上配置 MPLS。
[edit protocols mpls]
user@P4# set interface ge-0/0/1.0 user@P4# set interface ge-0/0/2.0 user@P4# set interface ge-0/0/3.0在接口上启用 RSVP。
[edit protocols rsvp]
user@P4# set interface ge-0/0/1.0 user@P4# set interface ge-0/0/2.0 user@P4# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P4# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.45.5/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.56.5/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.25.5/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.5/32; } } }
user@P4# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@P4# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@P4# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@P4# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 P5
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 P5:
配置设备接口。
[edit interfaces]
user@P5# set ge-0/0/1 unit 0 family inet address 192.168.56.6/24 user@P5# set ge-0/0/1 unit 0 family mpls user@P5# set ge-0/0/2 unit 0 family inet address 192.168.67.6/24 user@P5# set ge-0/0/2 unit 0 family mpls user@P5# set lo0 unit 0 family inet address 10.255.0.6/32在接口上配置 OSPF。
[edit protocols ospf]
user@P5# set traffic-engineering user@P5# set area 0.0.0.0 interface ge-0/0/1.0 user@P5# set area 0.0.0.0 interface ge-0/0/2.0 user@P5# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P5# set srlg srlg-a srlg-value 101 user@P5# set srlg srlg-a srlg-cost 10在接口上配置 MPLS。
[edit protocols mpls]
user@P5# set interface ge-0/0/1.0 user@P5# set interface ge-0/0/2.0在接口上启用 RSVP。
[edit protocols rsvp]
user@P5# set interface ge-0/0/1.0 user@P5# set interface ge-0/0/2.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P5# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.56.6/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.67.6/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.6/32; } } }
user@P5# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface lo0.0; }
user@P5# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0;
user@P5# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0;
user@P5# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 PE2
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 PE2:
配置设备接口。
[edit interfaces]
user@PE2# set ge-0/0/1 unit 0 family inet address 192.168.27.7/24 user@PE2# set ge-0/0/1 unit 0 family mpls user@PE2# set ge-0/0/2 unit 0 family inet address 192.168.37.7/24 user@PE2# set ge-0/0/2 unit 0 family mpls user@PE2# set ge-0/0/3 unit 0 family inet address 192.168.67.7/24 user@PE2# set ge-0/0/3 unit 0 family mpls user@PE2# set lo0 unit 0 family inet address 10.255.0.7/32在接口上配置 OSPF。
[edit protocols ospf]
user@PE2# set traffic-engineering user@PE2# set area 0.0.0.0 interface ge-0/0/1.0 user@PE2# set area 0.0.0.0 interface ge-0/0/2.0 user@PE2# set area 0.0.0.0 interface ge-0/0/3.0 user@PE2# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@PE2# set srlg srlg-a srlg-value 101 user@PE2# set srlg srlg-a srlg-cost 10在接口上配置 MPLS。
[edit protocols mpls]
user@PE2# set interface ge-0/0/1.0 user@PE2# set interface ge-0/0/2.0 user@PE2# set interface ge-0/0/3.0在接口上启用 RSVP。
[edit protocols rsvp]
user@PE2# set interface ge-0/0/1.0 user@PE2# set interface ge-0/0/2.0 user@PE2# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@PE2# show interfaces interfaces { ge-0/0/1 { unit 0 { family inet { address 192.168.27.7/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.37.7/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.67.7/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.7/32; } } } }
user@PE2# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@PE2# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE2# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE2# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
验证
确认配置工作正常。
验证 SRLG 成本是否已添加到 TE 链路中
目的
验证 SRLG 成本是否已添加到 TE 链路中(如果该链路属于受保护链路的 SRLG)。在 show ted link detail
设备 P1 上发出和 show rsvp session extensive bypass
命令。
行动
user@P1> show ted link detail ... 10.255.0.2->192.168.27.7-1, Local: 192.168.27.2, Remote: 0.0.0.0 Local interface index: 0, Remote interface index: 0 LocalPath: 0, Metric: 1, StaticBW: 1000Mbps, AvailBW: 1000Mbps Color: 0 <none> SRLGs: srlg-a localBW [0] 0bps [1] 0bps [2] 0bps [3] 0bps localBW [4] 0bps [5] 0bps [6] 0bps [7] 0bps [...] 10.255.0.3->192.168.37.7-1, Local: 192.168.37.3, Remote: 0.0.0.0 Local interface index: 0, Remote interface index: 0 LocalPath: 0, Metric: 1, StaticBW: 1000Mbps, AvailBW: 1000Mbps Color: 0 <none> SRLGs: srlg-a localBW [0] 0bps [1] 0bps [2] 0bps [3] 0bps localBW [4] 0bps [5] 0bps [6] 0bps [7] 0bps ...
user@P1> show rsvp session extensive bypass Ingress RSVP: 1 sessions 10.255.0.7 From: 10.255.0.2, LSPstate: Up, ActiveRoute: 0 LSPname: Bypass->192.168.27.7 LSPtype: Static Configured Suggested label received: -, Suggested label sent: - Recovery label received: -, Recovery label sent: 299776 Resv style: 1 SE, Label in: -, Label out: 299776 Time left: -, Since: Fri Oct 21 13:19:21 2011 Tspec: rate 0bps size 0bps peak Infbps m 20 M 1500 Port number: sender 1 receiver 52081 protocol 0 Type: Bypass LSP Number of data route tunnel through: 1 Number of RSVP session tunnel through: 0 PATH rcvfrom: localclient Adspec: sent MTU 1500 Path MTU: received 1500 PATH sentto: 192.168.25.5 (ge-0/0/4.0) 26 pkts RESV rcvfrom: 192.168.25.5 (ge-0/0/4.0) 26 pkts Explct route: 192.168.25.5 192.168.56.6 192.168.67.7 Record route: <self> 192.168.25.5 192.168.56.6 192.168.67.7 Total 1 displayed, Up 1, Down 0
意义
绕过保护链路 P1->PE2 的最短路径是 P1->P2->PE2。由于链路 P1>PE2 和 P2>PE2 都属于 SRLG srlg-a
,因此链路 P2>PE2 的指标中添加了 10 的 srlg-a
SRLG 成本。这使得链路 P2>PE2 的指标过高,无法选择为最短路径。因此,用于旁路的计算路径的 CSPF 结果将成为 P1>P4>P5>PE2。
示例:使用排除 srlg 选项配置带链路保护的 SRLG
此示例说明如何使用 选项配置具有链路保护的 exclude-srlg
SRLG。
要求
此示例使用以下硬件和软件组件:
M 系列、MX 系列或 T 系列设备
所有设备上运行的 Junos OS 版本 11.4 或更高版本
概述
在此示例中,PE1 是入口路由器,而 PE2 是出口路由器。P1、P2 和 P3、P4 和 P5 是传输路由器。OSPF 配置在所有路由器上作为内部网关协议 (IGP)。SRLG 配置在所有七个路由器上。链路 P1>PE2(主路径)和链路 P2>PE2 属于 SRLG srlg-a
。
通过将语句和选项包括 link-protection
在一起 exclude-srlg
,可为接口 P1>PE2 配置链路保护。这使得旁路 LSP 和受保护链路在任何 SRLG 中完全脱节。
在链路 P1>PE2 和 P2>PE2 上配置 SRLG srlg-a
时,由于配置,链 exclude-srlg
路 P2>PE2 会被拒绝 CSPF 注意。因此,旁路的计算路径变为 P1>P4>P5>PE2。
拓扑

配置
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,移除任何换行符,更改与网络配置匹配所需的任何详细信息,然后将命令复制粘贴到层次结构级别的 [edit]
CLI 中。
路由器 PE1
set interfaces ge-0/0/1 unit 0 family inet address 192.168.12.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.13.1/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.14.1/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.1/32 set routing-options srlg srlg-a srlg-value 101 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.0 set protocols mpls optimize-timer 120 set protocols mpls label-switched-path pe1-pe2 to 10.255.0.7 set protocols mpls label-switched-path pe1-pe2 link-protection set protocols mpls label-switched-path pe1-pe2 primary via-p1 set protocols mpls label-switched-path pe1-pe2 secondary path2 standby set protocols mpls path via-p1 10.255.0.2 strict set protocols mpls path path2 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 ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
路由器 P1
set interfaces ge-0/0/1 unit 0 family inet address 192.168.12.2/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.27.2/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.23.2/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces ge-0/0/4 unit 0 family inet address 192.168.25.2/24 set interfaces ge-0/0/4 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.2/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 link-protection exclude-srlg set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 srlg srlg-a set protocols mpls interface ge-0/0/3.0 set protocols mpls interface ge-0/0/4.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface ge-0/0/4.0 set protocols ospf area 0.0.0.0 interface lo0.0
路由器 P2
set interfaces ge-0/0/1 unit 0 family inet address 192.168.13.3/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.37.3/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.23.3/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.3/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 srlg srlg-a set protocols mpls interface ge-0/0/3.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
路由器 P3
set interfaces ge-0/0/1 unit 0 family inet address 192.168.14.4/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.45.4/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.4/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 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
路由器 P4
set interfaces ge-0/0/1 unit 0 family inet address 192.168.45.5/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.56.5/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.25.5/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.5/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.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 ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
路由器 P5
set interfaces ge-0/0/1 unit 0 family inet address 192.168.56.6/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.67.6/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.6/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 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
路由器 PE2
set interfaces ge-0/0/1 unit 0 family inet address 192.168.27.7/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 192.168.37.7/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 192.168.67.7/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.0.7/32 set routing-options srlg srlg-a srlg-value 101 set routing-options srlg srlg-a srlg-cost 10 set protocols rsvp interface ge-0/0/1.0 set protocols rsvp interface ge-0/0/2.0 set protocols rsvp interface ge-0/0/3.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 ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0
配置设备 PE1
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置入口路由器 PE1:
配置设备接口。
[edit interfaces]
user@PE1# set ge-0/0/1 unit 0 family inet address 192.168.12.1/24 user@PE1# set ge-0/0/1 unit 0 family mpls user@PE1# set ge-0/0/2 unit 0 family inet address 192.168.13.1/24 user@PE1# set ge-0/0/2 unit 0 family mpls user@PE1# set ge-0/0/3 unit 0 family inet address 192.168.14.1/24 user@PE1# set ge-0/0/3 unit 0 family mpls user@PE1# set lo0 unit 0 family inet address 10.255.0.1/32在接口上配置 OSPF。
[edit protocols ospf]
user@PE1# set traffic-engineering user@PE1# set area 0.0.0.0 interface ge-0/0/1.0 user@PE1# set area 0.0.0.0 interface ge-0/0/2.0 user@PE1# set area 0.0.0.0 interface ge-0/0/3.0 user@PE1# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@PE1# set routing-options srlg srlg-a srlg-value 101 user@PE1# set routing-options srlg srlg-a srlg-cost 10配置 MPLS 和 LSP 并为 LSP 配置链路保护
pe1-pe2
。[edit protocols mpls]
user@PE1# set interface ge-0/0/1.0 user@PE1# set interface ge-0/0/2.0 user@PE1# set interface ge-0/0/3.0 user@PE1# set optimize-timer 120 user@PE1# set label-switched-path pe1-pe2 to 10.255.0.7 user@PE1# set protocols mpls label-switched-path pe1-pe2 link-protection user@PE1# set label-switched-path pe1-pe2 primary via-p1 user@PE1# set label-switched-path pe1-pe2 secondary path2 standby user@PE1# set path via-p1 10.255.0.2 strict user@PE1# set path path2在接口上启用 RSVP。
[edit protocols rsvp]
user@PE1# set interface ge-0/0/1.0 user@PE1# set interface ge-0/0/2.0 user@PE1# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show routing-options
、 show protocols mpls
和 show protocols rsvp
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@PE1# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.12.1/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.13.1/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.14.1/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.1/32; } } } }
user@PE1# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@PE1# show protocols mpls optimize-timer 120; label-switched-path pe1-pe2 { to 10.255.0.7; link-protection; primary via-p1; secondary path2 { standby; } } path via-p1 { 10.255.0.2 strict; } path path2; interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE1# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE1# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit
。
配置设备 P1
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置设备 P1:
配置设备接口。
[edit interfaces]
user@P1# set ge-0/0/1 unit 0 family inet address 192.168.12.2/24 user@P1# set ge-0/0/1 unit 0 family mpls user@P1# set ge-0/0/2 unit 0 family inet address 192.168.27.2/24 user@P1# set ge-0/0/2 unit 0 family mpls user@P1# set ge-0/0/3 unit 0 family inet address 192.168.23.2/24 user@P1# set ge-0/0/3 unit 0 family mpls user@P1# set ge-0/0/4 unit 0 family inet address 192.168.25.2/24 user@P1# set ge-0/0/4 unit 0 family mpls user@P1# set lo0 unit 0 family inet address 10.255.0.2/32在接口上配置 OSPF。
[edit protocols ospf]
user@P1# set traffic-engineering user@P1# set area 0.0.0.0 interface ge-0/0/1.0 user@P1# set area 0.0.0.0 interface ge-0/0/2.0 user@P1# set area 0.0.0.0 interface ge-0/0/3.0 user@P1# set area 0.0.0.0 interface ge-0/0/4.0 user@P1# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P1# set routing-options srlg srlg-a srlg-value 101 user@P1# set routing-options srlg srlg-a srlg-cost 10在接口上配置 MPLS 并将 SRLG 与 P1>PE2 链路的接口 ge-0/0/2.0 相关联。
[edit protocols mpls]
user@P1# set interface ge-0/0/1.0 user@P1# set interface ge-0/0/2.0 srlg srlg-a user@P1# set interface ge-0/0/3.0 user@P1# set interface ge-0/0/4.0在接口上启用 RSVP,并将语
link-protection
句包括在接口ge-0/0/2.0
选项中exclude-srlg
。[edit protocols rsvp]
user@P1# set interface ge-0/0/1.0 user@P1# set interface ge-0/0/2.0 link-protection exclude-srlg user@P1# set interface ge-0/0/3.0 user@P1# set interface ge-0/0/4.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P1# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.12.2/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.27.2/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.23.2/24; } family mpls; } } ge-0/0/4 { unit 0 { family inet { address 192.168.25.2/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.2/32; } } }
user@P1# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface ge-0/0/4.0; interface lo0.0; }
user@P1# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0 { srlg srlg-a; } interface ge-0/0/3.0; interface ge-0/0/4.0;
user@P1# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0 { link-protection { exclude-srlg; } interface ge-0/0/3.0; interface ge-0/0/4.0; }
user@P1# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit
。
配置设备 P2
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 P2:
配置设备接口。
[edit interfaces]
user@P2# set ge-0/0/1 unit 0 family inet address 192.168.13.3/24 user@P2# set ge-0/0/1 unit 0 family mpls user@P2# set ge-0/0/2 unit 0 family inet address 192.168.37.3/24 user@P2# set ge-0/0/2 unit 0 family mpls user@P2# set ge-0/0/3 unit 0 family inet address 192.168.23.3/24 user@P2# set ge-0/0/3 unit 0 family mpls user@P2# set lo0 unit 0 family inet address 10.255.0.3/32在接口上配置 OSPF。
[edit protocols ospf]
user@P2# set traffic-engineering user@P2# set area 0.0.0.0 interface ge-0/0/1.0 user@P2# set area 0.0.0.0 interface ge-0/0/2.0 user@P2# set area 0.0.0.0 interface ge-0/0/3.0 user@P2# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P2# set routing-options srlg srlg-a srlg-value 101 user@P2# set routing-options srlg srlg-a srlg-cost 10在接口上配置 MPLS 并将 SRLG 与 P2>PE2 链路的接口 ge-0/0/2.0 相关联。
[edit protocols mpls]
user@P2# set interface ge-0/0/1.0 user@P2# set interface ge-0/0/2.0 srlg srlg-a user@P2# set interface ge-0/0/3.0在接口上启用 RSVP。
[edit protocols rsvp]
user@P2# set interface ge-0/0/1.0 user@P2# set interface ge-0/0/2.0 user@P2# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P2# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.13.3/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.37.3/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.23.3/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.3/32; } } } }
user@P2# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@P2# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0 { srlg srlg-a; } interface ge-0/0/3.0; }
user@P2# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@P2# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 P3
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 P3:
配置设备接口。
[edit interfaces]
user@P3# set ge-0/0/1 unit 0 family inet address 192.168.14.4/24 user@P3# set ge-0/0/1 unit 0 family mpls user@P3# set ge-0/0/2 unit 0 family inet address 192.168.45.4/24 user@P3# set ge-0/0/2 unit 0 family mpls user@P3# set lo0 unit 0 family inet address 10.255.0.4/32在接口上配置 OSPF。
[edit protocols ospf]
user@P3# set traffic-engineering user@P3# set area 0.0.0.0 interface ge-0/0/1.0 user@P3# set area 0.0.0.0 interface ge-0/0/2.0 user@P3# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P3# set routing-options srlg srlg-a srlg-value 101 user@P3# set routing-options srlg srlg-a srlg-cost 10在接口上配置 MPLS。
[edit protocols mpls]
user@P3# set interface ge-0/0/1.0 user@P3# set interface ge-0/0/2.0在接口上启用 RSVP。
[edit protocols rsvp]
user@P3# set interface ge-0/0/1.0 user@P3# set interface ge-0/0/2.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P3# show interfaces interfaces { ge-0/0/1 { unit 0 { family inet { address 192.168.14.4/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.45.4/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.4/32; } } } }
user@P3# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface lo0.0; }
user@P3# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0;
user@P3# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0;
user@P3# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 P4
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 P4:
配置设备接口。
[edit interfaces]
user@P4# set ge-0/0/1 unit 0 family inet address 192.168.45.5/24 user@P4# set ge-0/0/1 unit 0 family mpls user@P4# set ge-0/0/2 unit 0 family inet address 192.168.56.5/24 user@P4# set ge-0/0/2 unit 0 family mpls user@P4# set ge-0/0/3 unit 0 family inet address 192.168.25.5/24 user@P4# set ge-0/0/3 unit 0 family mpls user@P4# set lo0 unit 0 family inet address 10.255.0.5/32在接口上配置 OSPF。
[edit protocols ospf]
user@P4# set traffic-engineering user@P4# set area 0.0.0.0 interface ge-0/0/1.0 user@P4# set area 0.0.0.0 interface ge-0/0/2.0 user@P4# set area 0.0.0.0 interface ge-0/0/3.0 user@P4# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P4# set routing-options srlg srlg-a srlg-value 101 user@P4# set routing-options srlg srlg-a srlg-cost 10在接口上配置 MPLS。
[edit protocols mpls]
user@P4# set interface ge-0/0/1.0 user@P4# set interface ge-0/0/2.0 user@P4# set interface ge-0/0/3.0在接口上启用 RSVP。
[edit protocols rsvp]
user@P4# set interface ge-0/0/1.0 user@P4# set interface ge-0/0/2.0 user@P4# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P4# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.45.5/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.56.5/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.25.5/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.5/32; } } }
user@P4# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@P4# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@P4# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@P4# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 P5
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 P5:
配置设备接口。
[edit interfaces]
user@P5# set ge-0/0/1 unit 0 family inet address 192.168.56.6/24 user@P5# set ge-0/0/1 unit 0 family mpls user@P5# set ge-0/0/2 unit 0 family inet address 192.168.67.6/24 user@P5# set ge-0/0/2 unit 0 family mpls user@P5# set lo0 unit 0 family inet address 10.255.0.6/32在接口上配置 OSPF。
[edit protocols ospf]
user@P5# set traffic-engineering user@P5# set area 0.0.0.0 interface ge-0/0/1.0 user@P5# set area 0.0.0.0 interface ge-0/0/2.0 user@P5# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@P5# set routing-options srlg srlg-a srlg-value 101 user@P5# set routing-options srlg srlg-a srlg-cost 10在接口上配置 MPLS。
[edit protocols mpls]
user@P5# set interface ge-0/0/1.0 user@P5# set interface ge-0/0/2.0在接口上启用 RSVP。
[edit protocols rsvp]
user@P5# set interface ge-0/0/1.0 user@P5# set interface ge-0/0/2.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@P5# show interfaces ge-0/0/1 { unit 0 { family inet { address 192.168.56.6/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.67.6/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.6/32; } } }
user@P5# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface lo0.0; }
user@P5# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0;
user@P5# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0;
user@P5# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
配置设备 PE2
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 Junos OS CLI 用户指南。
要配置 PE2:
配置设备接口。
[edit interfaces]
user@PE2# set ge-0/0/1 unit 0 family inet address 192.168.27.7/24 user@PE2# set ge-0/0/1 unit 0 family mpls user@PE2# set ge-0/0/2 unit 0 family inet address 192.168.37.7/24 user@PE2# set ge-0/0/2 unit 0 family mpls user@PE2# set ge-0/0/3 unit 0 family inet address 192.168.67.7/24 user@PE2# set ge-0/0/3 unit 0 family mpls user@PE2# set lo0 unit 0 family inet address 10.255.0.7/32在接口上配置 OSPF。
[edit protocols ospf]
user@PE2# set traffic-engineering user@PE2# set area 0.0.0.0 interface ge-0/0/1.0 user@PE2# set area 0.0.0.0 interface ge-0/0/2.0 user@PE2# set area 0.0.0.0 interface ge-0/0/3.0 user@PE2# set area 0.0.0.0 interface lo0.0配置 SRLG 定义。
[edit routing-options]
user@PE2# set routing-options srlg srlg-a srlg-value 101 user@PE2# set routing-options srlg srlg-a srlg-cost 10在接口上配置 MPLS。
[edit protocols mpls]
user@PE2# set interface ge-0/0/1.0 user@PE2# set interface ge-0/0/2.0 user@PE2# set interface ge-0/0/3.0在接口上启用 RSVP。
[edit protocols rsvp]
user@PE2# set interface ge-0/0/1.0 user@PE2# set interface ge-0/0/2.0 user@PE2# set interface ge-0/0/3.0
结果
在配置模式下,输入 show interfaces,
show protocols ospf
、 show protocols mpls
、 show protocols rsvp
和 show routing-options
命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@PE2# show interfaces interfaces { ge-0/0/1 { unit 0 { family inet { address 192.168.27.7/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 192.168.37.7/24; } family mpls; } } ge-0/0/3 { unit 0 { family inet { address 192.168.67.7/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.0.7/32; } } } }
user@PE2# show protocols ospf traffic-engineering; area 0.0.0.0 { interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; }
user@PE2# show protocols mpls interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE2# show protocols rsvp interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0;
user@PE2# show routing-options srlg { srlg-a { srlg-value 101; srlg-cost 10; } }
如果完成设备配置,请在配置模式下输入 commit 。
验证
确认配置工作正常。
验证 SRLG 成本是否已添加到 TE 链路中
目的
在配置exclude-srlg
时,验证 TE 链路是否属于受保护链路link-protection
的 SRLG。在 show ted link detail
设备 P1 上发出和 show rsvp session extensive bypass
命令。
行动
user@P1> show ted link detail ... 10.255.0.2->192.168.27.7-1, Local: 192.168.27.2, Remote: 0.0.0.0 Local interface index: 0, Remote interface index: 0 LocalPath: 0, Metric: 1, StaticBW: 1000Mbps, AvailBW: 1000Mbps Color: 0 <none> SRLGs: srlg-a localBW [0] 0bps [1] 0bps [2] 0bps [3] 0bps localBW [4] 0bps [5] 0bps [6] 0bps [7] 0bps [...] 10.255.0.3->192.168.37.7-1, Local: 192.168.37.3, Remote: 0.0.0.0 Local interface index: 0, Remote interface index: 0 LocalPath: 0, Metric: 1, StaticBW: 1000Mbps, AvailBW: 1000Mbps Color: 0 <none> SRLGs: srlg-a localBW [0] 0bps [1] 0bps [2] 0bps [3] 0bps localBW [4] 0bps [5] 0bps [6] 0bps [7] 0bps ...
user@P1> show rsvp session extensive bypass Ingress RSVP: 1 sessions 10.255.0.7 From: 10.255.0.2, LSPstate: Up, ActiveRoute: 0 LSPname: Bypass->192.168.27.7 LSPtype: Static Configured Suggested label received: -, Suggested label sent: - Recovery label received: -, Recovery label sent: 299776 Resv style: 1 SE, Label in: -, Label out: 299776 Time left: -, Since: Fri Oct 21 13:19:21 2011 Tspec: rate 0bps size 0bps peak Infbps m 20 M 1500 Port number: sender 1 receiver 52081 protocol 0 Type: Bypass LSP Number of data route tunnel through: 1 Number of RSVP session tunnel through: 0 PATH rcvfrom: localclient Adspec: sent MTU 1500 Path MTU: received 1500 PATH sentto: 192.168.25.5 (ge-0/0/4.0) 63 pkts RESV rcvfrom: 192.168.25.5 (ge-0/0/4.0) 63 pkts Explct route: 192.168.25.5 192.168.56.6 192.168.67.7 Record route: <self> 192.168.25.5 192.168.56.6 192.168.67.7 Total 1 displayed, Up 1, Down 0
意义
绕过保护链路 P1>PE2 的最短路径是 P1>P2>PE2。由于链路 P1>PE2 和 P2>PE2 均属于 SRLG srlg-a
,因此受 exclude-srlg
约束,链路 P2>PE2 被拒绝供 CSPF 考虑。因此,旁路的计算路径变为 P1>P4>P5>PE2。