用于 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)。
要求
此示例使用以下硬件和软件组件:
-
MX 系列路由器
-
所有设备上运行 Junos OS 11.4 或更高版本
概述
Junos OS 11.4 及更高版本支持 IGP(OSPFv2 和 IS-IS)域中的 SRLG 配置。在此示例中,您将配置 SRLG 并将其与设备上的 MPLS 接口相关联。
设备将 SRLG 成本参数用于约束最短路径优先 (CSPF) 算法,并尝试通过避免与主路径共享任何 SRLG 的链路来保持用于主路径和辅助路径的互斥性。
要配置 SRLG,首先在层次结构级别定义 [edit routing-options srlg srlg-name] SRLG 参数,然后在层次结构级别将 [edit mpls interface interface-name] SRLG 与 MPLS 接口相关联。
该 srlg srlg-name 语句具有以下选项:
-
srlg-cost— 包括 1 到 65535 之间的 SRLG 成本。SRLG 的成本决定了此 SRLG 对用于路径计算的 CSPF 算法的影响级别。成本越高,辅助路径与主路径共享相同 SRLG 的可能性就越小。默认情况下,为srlg-cost1。 -
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。有效链路指标加上 10 变 srlg-cost 为 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 protocols mplsshow routing-options和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 域中的每个瞻博网络路由器重复此过程。
验证
确认配置工作正常。
验证 SRLG 定义
目的
验证 SRLG 到值的映射和 SRLG 成本。
行动
user@PE1> show mpls srlg SRLG Value Cost srlg-a 101 10
验证流量工程链路 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) 链路。
要求
此示例使用以下硬件和软件组件:
-
MX 系列设备
-
所有设备上运行 Junos OS 11.4 或更高版本
概述
对于必须使辅助路径和主路径与任何通用 SRLG 完全分离的关键链路,您可以选择性地在 或 [edit protocols mpls label-switched-path path-name] 层次结构级别配置[edit protocols mpls]该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。由于已配置,CSPF exclude-srlg 会拒绝链路 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
此示例说明如何配置具有链路保护的 SRLG(不带该 exclude-srlg 选项)。
要求
此示例使用以下硬件和软件组件:
-
MX 系列设备
-
所有设备上运行 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 成本是否已添加到流量工程链路
目的
如果 SRLG 成本属于受保护链路的 SRLG,请验证是否已将其添加到流量工程链路中。在设备 P1 上发出和show ted link detailshow 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,因此 的 SRLG 成本 10 srlg-a 会添加到链路 P2>PE2 的度量中。这会使得链路 P2>PE2 的度量过高,无法为最短路径选择。因此,旁路计算路径的 CSPF 结果将变为 P1>P4>P5>PE2。
示例:使用 exclude-srlg 选项配置具有链路保护的 SRLG
此示例说明如何使用该 exclude-srlg 选项配置具有链路保护的 SRLG。
要求
此示例使用以下硬件和软件组件:
-
MX 系列设备
-
所有设备上运行 Junos OS 11.4 或更高版本
概述
在此示例中,PE1 是入口路由器,PE2 是出口路由器。P1、P2 和 P3、P4 和 P5 是中转路由器。OSPF 在所有路由器上配置为内部网关协议 (IGP)。所有七台路由器上都配置了 SRLG。链路 P1>PE2(主路径)和链路 P2>PE2 属于 SRLG srlg-a。
可以通过将语句与exclude-srlg选项一起包含link-protection来为接口 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,并将该语句与 interface
ge-0/0/2.0选项一起exclude-srlg包含在link-protection内。[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 成本是否已添加到流量工程链路
目的
验证当使用 时exclude-srlg,如果 流量工程 链路属于受保护链路link-protection的 SRLG,则该链路是否被排除在外。在设备 P1 上发出和show ted link detailshow 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。
用于 CSPF 路径选择的 RSVP-流量工程 SRLG 抑制
SRLG 抑制机制允许 CSPF 在计算 RSVP-流量工程 LSP 时避免近期不稳定的网络资源。
共享风险链路组 (SRLG) 抑制机制允许约束最短路径优先 (CSPF) 在计算 RSVP-流量工程标签交换路径 (LSP) 时避免近期不稳定的网络资源。
当与 SRLG 关联的链路遇到链路关闭事件时,SRLG 将在可配置的时间段内进入抑制状态。在此期间,CSPF 通过以下任一方式将属于该 SRLG 的链路视为不可取的:
-
通过将 SRLG 成本添加到流量工程指标来惩罚 SRLG 中的链路,或
-
从 CSPF 路径计算中完全排除 SRLG 中的链路。
一条链路可以有多个与之关联的 SRLG。如果链路出现故障,则与该链路关联的所有 SRLG 都将进入抑制状态。如果 SRLG 中的链路出现故障,则同一 SRLG 中的其他链路将被视为面临风险,因为它们共享通用底层资源。因此,抑制将应用于该 SRLG 中的所有链路,但那些专门配置为不参与的链路除外。
借助此功能,网络能够将流量从反复故障的资源上引导,同时尽可能保留路径可用性。
SRLG 抑制的好处
SRLG 压抑具有以下优势:
-
防止 CSPF 在发生故障后立即重用不稳定链路。
-
提高 LSP 稳定性并减少路径流失。
-
支持在需要时严格避免不稳定的 SRLG。
SRLG 抑制操作
本节介绍 SRLG 抑制事件的操作行为。
链路故障检测
每当在属于 SRLG 的链路上检测到链路故障时,就会触发 SRLG 抑制。当链路中断时,SRLG 将进入抑制状态,并且 CSPF 会重新计算备用路径。在配置的时间间隔内,抑制保持活动状态。
压抑期间
当 SRLG 处于抑制状态时,CSPF 可以在以下两种模式之一下运行:
-
度量惩罚模式(默认) — CSPF 将可配置的 SRLG 成本 (
srlg-cost) 添加到受影响链路的流量工程度量中,作为 CSPF 路径计算中的实际度量。例如:Base TE Metric = 20 SRLG Cost = 100 Effective Metric = 120
链路仍然可用,但在选择 CSPF 路径期间,链路的首选级会降低。这种方法既能保持路径的可行性,又能引导流量远离不稳定资源。
-
排除模式 — 如果配置了该
exclude-srlg语句,并且当 SRLG 遇到链路关闭事件时,SRLG 将进入抑制状态。在 CSPF 路径计算过程中,SRLG 中受影响的链路将被排除。这种排除可确保严格避免不稳定的 SRLG。
与现有 SRLG 约束的交互
SRLG 抑制是现有的基于 SRLG 的 CSPF 机制之外还可发挥作用,包括:
-
快速重新路由 (FRR) 旁路计算
-
现有 CSPF 排除策略
如果多个机制影响路径选择,则排除优先于度量惩罚。
SRLG 抑制配置
要启用 SRLG 抑制功能,必须在 [edit protocols mpls srlg-hold-down] 层次结构级别下的全局级别配置 SRLG 抑制策略。您可以在 [edit routing-options srlg srlg-name] 层次结构级别下启用单独的 SRLG 抑制。需要全局 SRLG 抑制配置才能使各个 SRLG 抑制配置生效。
默认情况下,SRLG 抑制配置处于禁用状态。启用 SRLG 抑制后,除非另有说明,否则所有 SRLG 都会参与。
在全局级别,以下 SRLG 抑制配置选项在 [edit protocols mpls srlg-hold-down] 层次结构级别下可用:
-
exclude-all— 从抑制中排除所有 SRLG。只有显式配置为 participate 的includeSRLG。 -
cost— 指定应用于未显式配置 SRLG 成本的 SRLG 的默认惩罚。范围介于 1 到 65535 之间。默认值为 1。 -
interval— 指定所有 SRLG 的抑制持续时间。范围介于 1 到 4294967295 秒之间。默认设置为 10 秒。 -
no-extend- 禁用抑制计时器的自动扩展。默认情况下,后续触发器会延长过期时间。 -
exclude-srlg— 指示 CSPF 在 SRLG 处于抑制状态时排除与 SRLG 关联的链路。 -
no-log— 防止为新的 SRLG 抑制事件生成系统日志消息。减少日志记录开销,并防止在频繁发生 SRLG 相关事件的网络中生成过多的消息。
在单个 SRLG 级别,以下 SRLG 抑制配置选项在 [edit routing-options srlg srlg-name] 层次结构级别下可用:
-
srlg-cost srlg-cost- 指定在抑制期间应用的成本。范围介于 1 到 65535 之间。 -
srlg-value srlg-value- 指定 SRLG 标识符。范围介于 1 到 4294967295 之间。 -
srlg-hold-down-exclude- 从抑制处理中排除 SRLG。 -
srlg-hold-down-include— 在抑制处理中包括一个 SRLG。通常与exclude-all全局配置一起使用。 -
srlg-hold-down-interval— 覆盖全局 SRLG 抑制持续时间。
示例配置示例
以下是全局和单个 SRLG 级别的 SRLG 抑制配置示例:
全局级别的 SRLG 抑制配置:
user@host> show configuration protocol mpls
srlg-hold-down {
interval 100;
cost 2;
}
interface ge-0/0/2.0 {
srlg green;
}
interface ge-0/0/3.0 {
srlg green;
}
interface ge-0/0/4.0 {
srlg red;
}
单个 SRLG 级别的 SRLG 抑制配置:
user@host> show configuration routing-options
...
srlg {
green srlg-value 2;
red {
srlg-value 3;
srlg-cost 5;
srlg-hold-down-interval 200;
}
}
验证
您可以使用和show mpls srlg detail命令show mpls srlg查看 SRLG 名称、值、成本、抑制状态和间隔的详细信息。