如何启用严格的 SPF SID 和 IGP 快捷方式
了解严格的 SPF (SR-Algo 1) 和 IGP 快捷键
严格的 SPF (SR-Algo 1) 和 IGP 快捷方式提供以下优势
严格 SPF (SR-Algo 1) 和 IGP 快捷方式的好处
-
增强分段路由功能。
-
通过创建 SR-TE 隧道以使用最短 IGP 路径转发流量来帮助避免环路。
-
启用 SPRING 时,默认情况下能够使用 SR-Algo 1(严格 SPF)和 SR-Algo 0(默认 SPF)。
严格 SPF (SR-Algo 1) 和 IGP 快捷键概述
分段路由 (SR) 可以去除中间路由器中的网络状态信息并将路径信息置于入口节点的数据包标头中,以此简化运维并降低网络对资源的需求。但是,在某些情况下,当存在嵌套的 SR-TE 隧道,并且设备通过这些 SR-TE 隧道转发流量时,流量可能会循环,从而造成拥塞,并且不会通过最短 IGP 路径转发流量。
从 Junos OS 21.1R1 版开始,您可以播发 SR 算法 1(严格 SPF)并使用严格 SPF SID 创建 SR-TE 隧道。此类 SR-TE 隧道仅使用严格路径 SPF(而非本地策略)来到达隧道端点。您可以在导入策略中指定前缀,隧道根据这些前缀将流量重定向到特定目标。此外,启用 SPRING 时,默认情况下可以使用 SR-Algo 1(严格 SPF)和 SR-Algo 0(默认 SPF)。
您可以在 IS-IS LSPDU 中播发严格 SPF SID,并使用这些 SID 创建 SR-TE 隧道,以便在不造成环路的情况下通过最短 IGP 路径转发流量。然后,标记为 IS-IS 的路由将在您愿意spring-te tunnel
时在 inet-mpls family
或 inet6-mpls family
配置中使用带有预定义快捷方式语句的隧道。
下图描述了在没有严格 SPF SID 的情况下创建的 SR-TE 隧道与使用严格 SPF (SR-Algo 1) SID 创建的 SR-TE 隧道之间的区别:

图 A 显示了一个网络拓扑,其中当预先存在的 SR-TE 隧道(或 RSVP 隧道)被选为 P1 节点的入口时,不会使用最短 IGP 路径创建 SR-TE 隧道来转发流量。此拓扑中存在两个 SR-TE 隧道。一条隧道从 P1 经由 P0 到 P6(隧道 a,蓝色),另一条隧道经由 P6 从 P1 到 P7(隧道 b,绿色)。在这种情况下,不会使用最短 IGP 路径创建隧道 (b)。因此,由于在 P1 节点上启用了快捷方式语句,标签 IS-IS 路由不是利用现有隧道到达 P6 然后转发到 P7,而是 inet-mpls
使用 SR-TE 隧道 (a) 转发发往 P7 的流量,避开最短 IGP 路径,从而导致隧道 (a) 上的流量拥塞。
图 B 显示了流量环路的拓扑。当标记的 IS-IS 路由选择 SR-TE 隧道作为入口并重定向到另一个 SR-TE 隧道时,流量将循环。在此拓扑中,我们有两个 SR-TE 隧道,一个从 P0 经由 P2 到 P6,另一个隧道从 P1 经 P6 到 P2。对于从 P0 发送到 P6 节点的数据包,在 P0,如果该节点选择 SR-TE 隧道作为目标 2.2.2.6 的入口,它将推送 P2 标签并转发到 P1。在 P1 处,通过 P6 存在另一个 SR-TE 隧道,并在 mpls.0 表中带有标签。当 P1 接收到此流量到达 P2 节点时,它将使用 SR-TE 隧道上的 L-ISIS 路由快捷方式,并使用相同的标签推送 P6,然后转发到 P0 节点。在 P0 处,顶部标签与 P6 相同,这意味着如果 SR-TE 再次建立隧道,它将推送 P2 标签并将流量转发到 P1,后者将循环。
图 C 显示了使用严格 SPF SID 创建的 SR-TE 隧道,这些隧道现在支持 SR-Algo 1 和预先存在的 SR-Algo 0。仅当下一跳节点也支持 SR 算法 1 时,才会在 IS-IS 中安装 Strict-SPF SID 路由。否则,流量将被丢弃。如果您使用严格的 SPF SID 创建了 SR-TE 隧道,并且路径上设备未播发对 SR 算法 1 的支持,则隧道将保持关闭状态。当使用严格 SPF SID 创建隧道时,它将采用最短的 IGP 路径到达另一个隧道端点,从而避免拥塞。在流量环路(如图 2 所示)的场景中,严格 SPF SID 只会由参与支持 SR 算法 1 的 SR 域中的每个节点在 IS-IS LSPDU 中通告。可以有多个 SR-TE 隧道,这些隧道既可以是使用 Strict-SPF SIDS 创建的,也可以是普通 SID 创建的。当作员在创建显式路由对象 (ERO) 之前配置语句 “use-for-shortcut” 时,将使用严格的 SPF SID 创建隧道。
示例:在 SPRING 中为 IS-IS 协议配置严格的 SPF SID 并启用 IGP 快捷方式
概述
通常,当网络中存在嵌套的 SR-TE 隧道,并且设备通过这些 SR-TE 隧道转发流量时,流量可能不会通过最短 IGP 路径进行转发。因此,流量可能会循环。
从 Junos OS 21.1R1 版开始,您可以播发 SR 算法,并使用严格的 SPF SID 创建 SR-TE 隧道,以便使用最短 IGP 路径转发流量,以避免环路。当您启用spring-te
时,标记为 IS-IS 的路由现在将使用此隧道,并在 family(或 inet6-mpls
family)下inet-mpls
显示预定义的快捷方式旋钮。
要求
此示例使用以下硬件和软件组件:
-
八台 MX 系列路由器
-
在所有设备上运行的 Junos OS 21.1R1 或更高版本
拓扑学
在以下示例中,我们将演示环路如何在具有多个 SR-TE 隧道的网络中发生,以及如何使用由 SR 算法 1 创建的严格 SPF SID 来解析环路。示例拓扑有两个 SR-TE 隧道。R0>R2>R6 的隧道 A 和 R1>R6>R2 的隧道 B。
在 R0 上,发往 R6 的数据包通常使用 IGP 最短路径:即 R0>R5>R6。当您将 SR-TE 隧道的入口节点配置为 R0(隧道 A)时,数据包需要通过 R2 作为其第一跳(目标:R6,标签:403002),这意味着发往 R6 的流量需要采用 R0>R2>R6 路径。要到达 R2,数据包需要首先到达 R0—R1 接口上的 R1,并403002第一个标签。R2 的标签403002应从 R1>R2 转发,标签堆栈没有更改。但是,在 R1 (R1>R6>R2) 上配置了第二个 SR-TE 隧道(隧道 B),目标为 R2,标签为 403006。来自 R0 的数据包在 R1 上顶部标签为 R2 (403002),最终使用第二个隧道到达 R6。但要到达 R1 上的 R6,R1—R0 (R1>R0>R5>R6) 是它需要使用的接口。因此,数据包再次到达 R0,整个过程重复,从而产生循环。
在所有设备上激活 SR 算法 1 并在相关设备上激活其标签后,当从入口设备 R0 到目标设备 R6 的数据包到达 R1(隧道 A)时,数据包将被转发至 R2。即使 R1 将 LSP 配置为将 R6 视为其下一跃点(隧道 B),它也会采用 IGP 最短路径 (R1>R2)。从 R2 通过隧道 A 到达 R6。

配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到 [编辑] 层次结构级别的 CLI 中。
根据 MX 系列路由器中的 MPC 类型,您可能需要显式启用增强型 IP 服务来支持 IS-IS 延迟功能。提交 set chassis network-services enhanced-ip
配置语句时,系统将提示您重新启动系统。
R0
set system host-name R0 set system ports console log-out-on-disconnect set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 10.0.10.10/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/1 unit 0 family inet address 10.0.10.20/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.255.10/32 set interfaces lo0 unit 0 family iso address 49.1921.6825.5010.00 set interfaces lo0 unit 0 family mpls maximum-labels 8 set policy-options policy-statement sspf term 1 from route-filter 192.168.255.10/32 exact set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3100 set policy-options policy-statement sspf term 1 then prefix-segment index 3000 set policy-options policy-statement sspf term 1 then prefix-segment node-segment set policy-options policy-statement sspf term 1 then accept set protocols isis interface ge-0/0/0.0 set protocols isis interface ge-0/0/1.0 set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 64000 set protocols isis source-packet-routing node-segment ipv4-index 1000 set protocols isis source-packet-routing flex-algorithm 128 set protocols isis backup-spf-options use-post-convergence-lfa maximum-labels 8 set protocols isis backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols isis backup-spf-options use-source-packet-routing set protocols isis traffic-engineering tunnel-source-protocol spring-te set protocols isis traffic-engineering family inet-mpls shortcuts set protocols isis export sspf set protocols mpls traceoptions file sspf-igp-short set protocols mpls traceoptions file size 100m set protocols mpls traceoptions file world-readable set protocols mpls traceoptions flag ted-export set protocols mpls traceoptions flag ted-import set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols rsvp interface all deactivate protocols rsvp interface all set protocols rsvp interface fxp0.0 disable deactivate protocols rsvp interface fxp0.0 disable set protocols source-packet-routing segment-list v4R0R7 h1 label 403102 set protocols source-packet-routing source-routing-path V4_R7 use-for-shortcut set protocols source-packet-routing source-routing-path V4_R7 to 192.168.255.6 set protocols source-packet-routing source-routing-path V4_R7 primary v4R0R7 set routing-options router-id 192.168.255.10 set routing-options autonomous-system 65540
R1
set system host-name R1 set system ports console log-out-on-disconnect set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 10.0.10.1/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/1 unit 0 family inet address 10.0.12.1/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.255.1/32 set interfaces lo0 unit 0 family iso address 49.1921.6825.5001.00 set interfaces lo0 unit 0 family mpls maximum-labels 8 set policy-options policy-statement sspf term 1 from route-filter 192.168.255.1/32 exact set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3101 set policy-options policy-statement sspf term 1 then prefix-segment index 3001 set policy-options policy-statement sspf term 1 then prefix-segment node-segment set policy-options policy-statement sspf term 1 then accept set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 64000 set protocols isis source-packet-routing node-segment ipv4-index 1001 set protocols isis source-packet-routing flex-algorithm 128 set protocols isis backup-spf-options use-post-convergence-lfa maximum-labels 8 set protocols isis backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols isis backup-spf-options use-source-packet-routing set protocols isis traffic-engineering tunnel-source-protocol spring-te set protocols isis traffic-engineering family inet-mpls shortcuts set protocols isis export sspf set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols source-packet-routing segment-list v4R1R2 h1 label 403106 set protocols source-packet-routing source-routing-path V4_R2 use-for-shortcut set protocols source-packet-routing source-routing-path V4_R2 to 192.168.255.2 set protocols source-packet-routing source-routing-path V4_R2 primary v4R1R2 set routing-options router-id 192.168.255.1 set routing-options autonomous-system 65540
R2
set system host-name R2 set system ports console log-out-on-disconnect set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 10.0.23.2/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/1 unit 0 family inet address 10.0.12.2/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.255.2/32 set interfaces lo0 unit 0 family iso address 49.1921.6825.5002.00 set interfaces lo0 unit 0 family mpls maximum-labels 8 set policy-options policy-statement sspf term 1 from route-filter 192.168.255.2/32 exact set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3102 set policy-options policy-statement sspf term 1 then prefix-segment index 3002 set policy-options policy-statement sspf term 1 then prefix-segment node-segment set policy-options policy-statement sspf term 1 then accept set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 64000 set protocols isis source-packet-routing node-segment ipv4-index 1002 set protocols isis source-packet-routing flex-algorithm 128 set protocols isis level 2 wide-metrics-only set protocols isis level 1 wide-metrics-only set protocols isis backup-spf-options use-post-convergence-lfa maximum-labels 8 set protocols isis backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols isis backup-spf-options use-source-packet-routing set protocols isis traffic-engineering tunnel-source-protocol spring-te set protocols isis traffic-engineering family inet-mpls shortcuts set protocols isis export sspf set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols source-packet-routing segment-list v4R2R6 h1 label 403100 set protocols source-packet-routing segment-list v4R2R6 h2 label 403107 set protocols source-packet-routing source-routing-path v4_R6 use-for-shortcut set protocols source-packet-routing source-routing-path v4_R6 to 192.168.255.2 set protocols source-packet-routing source-routing-path v4_R6 primary v4R2R6 set routing-options router-id 192.168.255.2 set routing-options autonomous-system 65540
R3
set system host-name R3 set system ports console log-out-on-disconnect set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 10.0.23.3/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/1 unit 0 family inet address 10.0.34.3/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.255.3/32 set interfaces lo0 unit 0 family iso address 49.1921.6825.5003.00 set interfaces lo0 unit 0 family mpls maximum-labels 8 set policy-options policy-statement sspf term 1 from route-filter 192.168.255.3/32 exact set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3103 set policy-options policy-statement sspf term 1 then prefix-segment index 3003 set policy-options policy-statement sspf term 1 then prefix-segment node-segment set policy-options policy-statement sspf term 1 then accept set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 64000 set protocols isis source-packet-routing node-segment ipv4-index 1003 set protocols isis source-packet-routing flex-algorithm 128 set protocols isis level 2 wide-metrics-only set protocols isis level 1 wide-metrics-only set protocols isis backup-spf-options use-post-convergence-lfa maximum-labels 8 set protocols isis backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols isis backup-spf-options use-source-packet-routing set protocols isis export sspf set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols source-packet-routing set routing-options router-id 192.168.255.3 set routing-options autonomous-system 65540
R4
set system host-name R4 set system ports console log-out-on-disconnect set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 10.0.34.4/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/1 unit 0 family inet address 10.0.47.4/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.255.4/32 set interfaces lo0 unit 0 family iso address 49.1921.6825.5004.00 set interfaces lo0 unit 0 family mpls maximum-labels 8 set policy-options policy-statement sspf term 1 from route-filter 192.168.255.4/32 exact set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3104 set policy-options policy-statement sspf term 1 then prefix-segment index 3004 set policy-options policy-statement sspf term 1 then prefix-segment node-segment set policy-options policy-statement sspf term 1 then accept set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 64000 set protocols isis source-packet-routing node-segment ipv4-index 1004 set protocols isis source-packet-routing flex-algorithm 128 set protocols isis level 2 wide-metrics-only set protocols isis level 1 wide-metrics-only set protocols isis backup-spf-options use-post-convergence-lfa maximum-labels 8 set protocols isis backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols isis backup-spf-options use-source-packet-routing set protocols isis export sspf set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols source-packet-routing set routing-options router-id 192.168.255.4 set routing-options autonomous-system 65540
R5
set system host-name R5 set system ports console log-out-on-disconnect set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 10.0.56.5/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/1 unit 0 family inet address 10.0.10.5/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.255.5/32 set interfaces lo0 unit 0 family iso address 49.1921.6825.5005.00 set interfaces lo0 unit 0 family mpls maximum-labels 8 set policy-options policy-statement sspf term 1 from route-filter 192.168.255.5/32 exact set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3105 set policy-options policy-statement sspf term 1 then prefix-segment index 3005 set policy-options policy-statement sspf term 1 then prefix-segment node-segment set policy-options policy-statement sspf term 1 then accept set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 64000 set protocols isis source-packet-routing node-segment ipv4-index 1005 set protocols isis source-packet-routing node-segment ipv6-index 2005 set protocols isis source-packet-routing flex-algorithm 128 set protocols isis level 2 wide-metrics-only set protocols isis level 1 wide-metrics-only set protocols isis backup-spf-options use-post-convergence-lfa maximum-labels 8 set protocols isis backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols isis backup-spf-options use-source-packet-routing set protocols isis export sspf set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols source-packet-routing set routing-options router-id 192.168.255.5 set routing-options autonomous-system 65540
R6
set system host-name R6 set system ports console log-out-on-disconnect set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 10.0.56.6/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/1 unit 0 family inet address 10.0.67.6/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.255.6/32 set interfaces lo0 unit 0 family iso address 49.1921.6825.5006.00 set interfaces lo0 unit 0 family mpls maximum-labels 8 set policy-options policy-statement sspf term 1 from route-filter 192.168.255.6/32 exact set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3106 set policy-options policy-statement sspf term 1 then prefix-segment index 3006 set policy-options policy-statement sspf term 1 then prefix-segment node-segment set policy-options policy-statement sspf term 1 then accept set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 64000 set protocols isis source-packet-routing node-segment ipv4-index 1006 set protocols isis source-packet-routing node-segment ipv6-index 2006 set protocols isis source-packet-routing flex-algorithm 128 set protocols isis level 2 wide-metrics-only set protocols isis level 1 wide-metrics-only set protocols isis backup-spf-options use-post-convergence-lfa maximum-labels 8 set protocols isis backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols isis backup-spf-options use-source-packet-routing set protocols isis export sspf set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols source-packet-routing set routing-options router-id 192.168.255.6 set routing-options autonomous-system 65540
R7
set system host-name R7 set system ports console log-out-on-disconnect set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 10.0.47.7/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/1 unit 0 family inet address 10.0.67.7/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.255.7/32 set interfaces lo0 unit 0 family iso address 49.1921.6825.5007.00 set interfaces lo0 unit 0 family mpls maximum-labels 8 set policy-options policy-statement sspf term 1 from route-filter 192.168.255.7/32 exact set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3107 set policy-options policy-statement sspf term 1 then prefix-segment index 3007 set policy-options policy-statement sspf term 1 then prefix-segment node-segment set policy-options policy-statement sspf term 1 then accept set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 64000 set protocols isis source-packet-routing node-segment ipv4-index 1007 set protocols isis source-packet-routing node-segment ipv6-index 2007 set protocols isis source-packet-routing flex-algorithm 128 set protocols isis level 2 wide-metrics-only set protocols isis level 1 wide-metrics-only set protocols isis backup-spf-options use-post-convergence-lfa maximum-labels 8 set protocols isis backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols isis backup-spf-options use-source-packet-routing set protocols isis export sspf set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols source-packet-routing set routing-options router-id 192.168.255.7 set routing-options autonomous-system 65540
在 SPRING 中启用默认 SID(算法 0)
-
在所有八个路由器上配置基本设备设置,例如主机名、IPv4 地址、环路接口地址、NET 地址、系列 ISO、系列 MPLS(为分段路由路由路径提供最大标签数)、
enhanced-ip
模式、路由器 ID 和自治系统 (AS) 编号。user@R0# set chassis network-services enhanced-ip set system host-name R0 set interfaces ge-0/0/0 unit 0 family inet address 10.0.10.10/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family mpls maximum-labels 8 set interfaces ge-0/0/1 unit 0 family inet address 10.0.10.20/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8 set interfaces lo0 unit 0 family inet address 192.168.255.10/32 set interfaces lo0 unit 0 family iso address 49.1921.6825.5010.00 set interfaces lo0 unit 0 family mpls maximum-labels 8 set routing-options router-id 192.168.255.10 set routing-options autonomous-system 65540
-
在所有 8 台设备的所有接口上启用 IS-IS、RSVP 和 MPLS 协议。还可以为 MPLS 指定跟踪文件和作。
user@R0# set protocols isis interface ge-0/0/0.0 set protocols isis interface ge-0/0/1.0 set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols mpls traceoptions file sspf-igp-short set protocols mpls traceoptions file size 100m set protocols mpls traceoptions file world-readable set protocols mpls traceoptions flag ted-export set protocols mpls traceoptions flag ted-import set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols rsvp interface all deactivate protocols rsvp interface all set protocols rsvp interface fxp0.0 disable deactivate protocols rsvp interface fxp0.0 disable
-
配置所有路由器以通告其环路地址,并指定前缀分段的索引和节点分段。
user@R0# set policy-options policy-statement sspf term 1 from route-filter 192.168.255.10/32 exact set policy-options policy-statement sspf term 1 then prefix-segment index 3000 set policy-options policy-statement sspf term 1 then prefix-segment node-segment set policy-options policy-statement sspf term 1 then accept
-
配置 SPRING 的 SRGB 的起始标签和索引范围。配置 IPv4 节点分段索引的值并分配 128 flex 算法。
user@R0# set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 64000 set protocols isis source-packet-routing node-segment ipv4-index 1000 set protocols isis source-packet-routing flex-algorithm 128
-
配置 IS-IS 协议中的最短路径优先 (SPF) 算法选项,以启用源数据包路由节点分段标签,用于计算 R0、R1 和 R2 上的备份路径。将最大标签设置为 8。
user@R0# set protocols isis backup-spf-options use-post-convergence-lfa maximum-labels 8 set protocols isis backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols isis backup-spf-options use-source-packet-routing
-
配置流量工程选项,以便从中
spring-te
选择标签交换路径,并将 MPLS 路径用作 R0、R1 和 R2 上的下一跃点。设置 IS-IS 导出策略。user@R0# set protocols isis traffic-engineering tunnel-source-protocol spring-te set protocols isis traffic-engineering family inet-mpls shortcuts set protocols isis export sspf
-
在 R0 上配置 R2 标签403002(为算法 0 创建,以创建默认 SPF SID),其中 R2 作为其到目标 R6 的下一跃点并启用
use-for-shortcut
。在 R1 和 R2 上创建标签。user@R0# set protocols source-packet-routing segment-list v4R0R7 h1 label 403002 set protocols source-packet-routing source-routing-path V4_R7 use-for-shortcut set protocols source-packet-routing source-routing-path V4_R7 to 192.168.255.6 set protocols source-packet-routing source-routing-path V4_R7 primary v4R0R7
user@R1# set protocols source-packet-routing segment-list v4R1R2 h1 label 403006 set protocols source-packet-routing source-routing-path V4_R2 use-for-shortcut set protocols source-packet-routing source-routing-path V4_R2 to 192.168.255.2 set protocols source-packet-routing source-routing-path V4_R2 primary v4R1R2
user@R2# set protocols source-packet-routing segment-list v4R2R6 h1 label 403000 set protocols source-packet-routing segment-list v4R2R6 h2 label 403007 set protocols source-packet-routing source-routing-path v4_R6 use-for-shortcut set protocols source-packet-routing source-routing-path v4_R6 to 192.168.255.2 set protocols source-packet-routing source-routing-path v4_R6 primary v4R2R6
-
输入
commit
命令以提交配置。
在 SPRING 中启用严格的 SPF SID(算法 1)
-
要将用于默认 SPF SID 的标签替换为用于严格 SPF SID 的标签,请配置以下内容:
user@R0# delete protocols source-packet-routing segment-list v4R0R7 h1 label 403002 set protocols source-packet-routing segment-list v4R0R7 h1 label 403102 set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3100
user@R1# delete protocols source-packet-routing segment-list v4R1R2 h1 label 403006 set protocols source-packet-routing segment-list v4R1R2 h1 label 403106 set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3101
user@R2# delete protocols source-packet-routing segment-list v4R2R6 h1 label 403000 set protocols source-packet-routing segment-list v4R2R6 h1 label 403100 delete protocols source-packet-routing segment-list v4R2R6 h2 label 403007 set protocols source-packet-routing segment-list v4R2R6 h2 label 403107 set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3102
-
在网络中的所有其他路由器上设置/激活算法 1。
user@R3# set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3103
user@R4# set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3104
user@R5# set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3105
user@R6# set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3106
user@R7# set policy-options policy-statement sspf term 1 then prefix-segment algorithm 1 index 3107
-
输入
commit
命令以提交所有配置。
结果
检查配置结果:
user@R0# show system { host-name R0; ports { console log-out-on-disconnect; } } chassis { network-services enhanced-ip; } interfaces { ge-0/0/0 { unit 0 { family inet { address 10.0.10.10/24; } family iso; family mpls { maximum-labels 8; } } } ge-0/0/1 { unit 0 { family inet { address 10.0.10.20/24; } family iso; family mpls { maximum-labels 8; } } } lo0 { unit 0 { family inet { address 192.168.255.10/32; } family iso { address 49.1921.6825.5010.00; } family mpls { maximum-labels 8; } } } } policy-options { policy-statement sspf { term 1 { from { route-filter 192.168.255.10/32 exact; } then { prefix-segment { algorithm 1 index 3100; index 3000; node-segment; } accept; } } } } protocols { isis { interface ge-0/0/0.0; interface ge-0/0/1.0; interface all; interface fxp0.0 { disable; } interface lo0.0 { passive; } source-packet-routing { srgb start-label 400000 index-range 64000; node-segment ipv4-index 1000; flex-algorithm 128; } backup-spf-options { use-post-convergence-lfa { maximum-labels 8; maximum-backup-paths 8; } use-source-packet-routing; } traffic-engineering { tunnel-source-protocol { spring-te; } family inet-mpls { shortcuts; } } export sspf; } mpls { traceoptions { file sspf-igp-short size 100m world-readable; flag ted-export; flag ted-import; } interface all; interface fxp0.0 { disable; } } rsvp { inactive: interface all; interface fxp0.0 { inactive: disable; } } source-packet-routing { segment-list v4R0R7 { h1 label 403102; } source-routing-path V4_R7 { use-for-shortcut; to 192.168.255.6; primary { v4R0R7; } } } } routing-options { router-id 192.168.255.10;
验证
验证 IS-IS 邻接
目的
验证路由设备上预期的 IS-IS 邻接。
行动
在作模式下,输入 show isis adjacency
命令。
user@R0> show isis adjacency Interface System L State Hold (secs) SNPA ge-0/0/0.0 R1 1 Up 23 56:4:15:0:1c:d2 ge-0/0/0.0 R1 2 Up 25 56:4:15:0:1c:d2 ge-0/0/1.0 R5 1 Up 25 56:4:15:0:1c:eb ge-0/0/1.0 R5 2 Up 24 56:4:15:0:1c:eb
意义
输出指示 R0 已在其ge-0/0/0.0
ge-0/0/1.0
和接口上成功形成 IS-IS 邻接,这些接口分别连接到其 R1 和 R5 路由器。
验证路由表 inet.3
目的
使用播发的路由表验证 inet.3
。
行动
在作模式下,输入 show route table inet.3
命令。
regress@R0> show route table inet.3 inet.3: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 192.168.255.1/32 *[L-ISIS/14] 3d 19:43:17, metric 10 > to 10.0.10.1 via ge-0/0/0.0 192.168.255.2/32 *[L-ISIS/14] 3d 19:43:17, metric 20 > to 10.0.10.1 via ge-0/0/0.0, Push 403002 192.168.255.3/32 *[L-ISIS/14] 3d 19:43:17, metric 30 > to 10.0.10.1 via ge-0/0/0.0, Push 403003 192.168.255.4/32 *[L-ISIS/14] 3d 19:43:17, metric 21 > to 10.0.10.1 via ge-0/0/0.0, Push 403004, Push 403002(top) 192.168.255.5/32 *[L-ISIS/14] 3d 19:43:17, metric 10 > to 10.0.10.5 via ge-0/0/1.0 192.168.255.6/32 *[SPRING-TE/8] 3d 19:43:17, metric 1, metric2 20 > to 10.0.10.1 via ge-0/0/0.0, Push 403002 [L-ISIS/14] 3d 19:43:17, metric 1 > to 10.0.10.1 via ge-0/0/0.0, Push 403002 192.168.255.7/32 *[L-ISIS/14] 3d 19:43:17, metric 11 > to 10.0.10.1 via ge-0/0/0.0, Push 403007, Push 403002(top)
意义
输出显示 inet.3 表上的路由。
验证路由标签(默认 SPF)
目的
验证在路由设备上为默认 SPF 创建的路由标签。
行动
在作模式下,输入 show route label 403002
命令。
user@R0> show route label 403002 mpls.0: 23 destinations, 23 routes (23 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 403002 *[L-ISIS/14] 3d 20:17:24, metric 20 > to 10.0.10.1 via ge-0/0/0.0, Swap 403002
regress@R1> show route label 403002 mpls.0: 23 destinations, 23 routes (23 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 403002 *[L-ISIS/14] 3d 20:31:53, metric 1 > to 10.0.10.10 via ge-0/0/0.0, Push 403006 403002(S=0) *[L-ISIS/14] 3d 20:31:53, metric 1 > to 10.0.10.10 via ge-0/0/0.0, Push 403006
意义
输出指示数据包正在将 R2 的标签403002推送到 R1,以到达其下一跃点 R2。但在 R1 上,它拾取隧道 B 并推送下一跃点 R6-403006 的标签,而不是在隧道 A 上从 R1 转发到 R2。
验证路由标签(严格 SPF)
目的
验证在路由设备上为严格 SPF 创建的路由标签。
行动
在作模式下,输入 show route label 403102
命令。
user@R0> show route label 403102 mpls.0: 32 destinations, 32 routes (32 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 403102 *[L-ISIS/14] 00:36:07, metric 20 > to 10.0.10.1 via ge-0/0/0.0, Swap 403102
regress@R1> show route label 403102 mpls.0: 32 destinations, 32 routes (32 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 403102 *[L-ISIS/14] 00:37:38, metric 10 > to 10.0.12.2 via ge-0/0/1.0, Pop 403102(S=0) *[L-ISIS/14] 00:37:38, metric 10 > to 10.0.12.2 via ge-0/0/1.0, Pop
意义
第一个输出表示带有 R2 标签的数据包已到达 R1。第二个输出表示数据包现在被转发到 R2(在隧道 A 上),而不是由 R1 上的隧道 B 选取。到达 R2 后,即可完成隧道 A 路径并到达 R6。