如何在 OSPFv2 分段路由网络中配置微环避免
总结 微环路会消耗链路的可用带宽,从而影响有用数据包的有效传输。微环路避免可以防止转发环路数据包。
了解 OSPF 微环避免
在采用分段路由的 OSPFv2 网络中避免微环路的好处
-
微无环路路径可避免延迟和流量丢失。
- 避免微环路可以防止转发环路数据包,并避免浪费带宽消耗。
- 微环避免路径仅在发生多个链路故障时针对受影响的链路计算。如果第二个链路故障不会影响计算出的微环路避免路径,OSPFv2 将继续使用相同的微环避免路径。
Junos OS 允许设备在 OSPFv2 链路出现故障时延迟 OSPFv2 路由下载,以避免微环路。当本地链路中断时,OSPFv2 协议会用数据库淹没整个区域。如果连接到发生故障的本地接口的节点收敛速度快于相邻节点,则连接的节点会将流量重定向到融合路径。这种重定向可能会导致流量的微循环,直到相邻节点收敛。当受保护节点的主路径发生故障时,如果配置的备份路径不受影响,则连接的节点不需要快速收敛。在这种情况向融合路径的流量将延迟到配置的延迟时间。此时间延迟有助于避免微环路,因为所有路由器不会同时到达收敛后转发状态。

在 图 1 中,从源到目标的主路径为 SR0R1R2R3D。当 R2 和 R3 之间的链路出现故障时,从 S 发送到 D 的流量将受到瞬态转发环路的影响,而路由器会更新其目标 D 的转发状态。
• 如果 R0 在 R5 之前更新其转发状态,则数据包将在 R0 和 R5 之间循环
• 如果 R0 和 R5 都更新了其转发状态,而 R4 未更新,则数据包将在 R4 和 R5 之间循环。
• R0 检测 R2 和 R3 之间的链路故障,并暂时通过 SR 路径 [NodeSID(R4), AdjSID(R4->R3), D] 将流量引导至目的地。
• 当配置的超时过后,R0 仅使用节点 SID 到 D 即可到达目标。
采用分段路由的 OSPFv2 网络中的微环路避免
从 Junos OS 22.1R1 版开始,您可以在设备上启用收敛后路径计算,以便在 OSPFv2 分段路由网络中发生链路或指标更改时避免出现微环路。要在 OSPFv2 分段路由网络中为本地和远程网络事件(包括链路断开、链路打开和指标更改)配置微环路避免,请在层次结构级别包含 maximum-labels
delay milliseconds
语句 [edit protocols ospf spf-options microloop avoidance post-convergence-path]
。要有效避免微环路,请在网络中的所有节点上配置此功能。
微环路避免不能替代像 TI-LFA 这样的本地修复机制,TI-LFA 可以非常快速地检测局部故障并激活预先计算的无环路替代路径。
实施微环路避免的路由器仅在收到事件的链路状态更新后计算微环路避免路径。因此,微环路避免机制不能替代像TI-LFA这样的局部修复机制,TI-LFA可以非常快速地检测局部故障,并在PFE级别激活预先计算的无环路替代路径。在上面的例子中,如果 R2R3 故障不存在本地修复机制,则在 R0 检测到故障(通过全局收敛)并编程微环路避免路径之前,将出现大量流量丢失。微环回避无法避免因故障检测延迟而导致的流量丢失。微环路避免可避免仅因微环路而导致的流量丢失。TI-LFA 和微环路避免等本地修复机制都必须在网络中的所有节点上启用,以确保流量丢失在毫秒范围内。
为避免微循环,使用以下过程:
1. 在计算到 D 的新路径后,R 在预定的时间内为 D 安装一个条目,该条目通过无环路分段路由路径将数据包引导至 D。此时间应大于网络中任何路由器的最坏情况延迟。
2. 配置的时间延迟后,R 将为 D 安装收敛后路由条目,该条目没有任何 SID。
支持和不支持的功能
在以下情况下,Junos OS 支持避免微循环:
-
所有支持 OSPF 路由协议的 Junos OS 平台都支持微环避免。
-
只有 IPv4 网络支持微环路避免。
-
灵活的算法拓扑支持微循环避免。
Junos OS 不支持以下与微循环避免结合使用的功能:
- 不支持需要 8 个以上标签的微环回避路径。为微环避免路径安装的最大标签数为 8。要使微环避免 ECMP 路径可用,标签数必须小于或等于最大标签数。
- 无法防止由于控制平面收敛缓慢而导致的流量丢失。
- 避免微环路不支持 OSPFv2 多拓扑。
- 微环避免功能不支持邻接 SID。
- 如果有快捷方式可用,OSPFv2 不提供微环避免路径。
在 OSPFv2 网络中配置分段路由微环避免
概述
微环路是在网络更改事件(如链路断开、链路打开或指标更改)之后在网络中发生的数据包转发环路。发生网络更改事件时,不同的路由器会在不同的时间更新其转发状态。这可能会导致数据包在上游和下游路由器之间短暂循环,从而导致数据包丢失、抖动和数据包无序。微环路会消耗链路的可用带宽,从而影响有用数据包的有效传输。
微环路避免可以防止转发环路数据包。分段路由微环路避免功能可检测在拓扑更改后是否可以使用微环路。检测到网络更改事件时,路由将被编程为采用融合后路径,该路径使用节点和邻接 SID 的组合。这可以确保可能尚未融合的路由器不会环路导致微环路的数据包。此行为持续可配置的延迟。延迟计时器过期后,将使用目标的节点 SID 对路由进行正常编程。
要求
此示例使用以下硬件和软件组件:
-
八个 MX 系列路由器。
-
Junos OS 版本 22.1R1 或更高版本。
拓扑学
在图 2 中,设备 R0 和设备 R7 是支持设备 CE1 和 CE2 的入口和出口路由器。设备 R1、R2、R3、R4、R5 和 R6 构成了仅支持 IPv4 的提供商核心网络。所有设备都属于同一个自治系统。OSPFv2 是核心中的内部网关协议,配置为支持微环路避免。在此示例中,设备 R2 配置为具有到 R0 和 R7 的 IBGP 对等会话的 IPv4 路由反射器。在此示例中,没有其他路由器使用 BGP。设备 R6 配置了防火墙过滤器,以检测带有微环路的数据包(如果发生链路关闭事件后的任何数据包)。

配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中。
设备 R0
set interfaces xe-0/0/0:0 description To_R1 set interfaces xe-0/0/0:0 unit 0 family inet address 10.10.1.1/30 set interfaces xe-0/0/0:0 unit 0 family mpls set interfaces xe-0/0/0:3 description To_R4 set interfaces xe-0/0/0:3 unit 0 family inet address 10.10.4.1/30 set interfaces xe-0/0/0:3 unit 0 family mpls set interfaces xe-0/0/1:2 description to_CE1 set interfaces xe-0/0/1:2 unit 1 family inet address 172.16.10.2/30 set interfaces xe-0/0/1:2 unit 1 family mpls set interfaces xe-0/0/1:2 unit 4 family inet address 172.16.11.2/30 set interfaces xe-0/0/1:2 unit 4 family mpls set interfaces lo0 unit 0 family inet address 192.168.255.10/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement prefix-sid term 1 from route-filter 192.168.255.10/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1000 set policy-options policy-statement prefix-sid term 1 then prefix-segment node-segment set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 192.168.255.10 set routing-options autonomous-system 65000 set routing-options forwarding-table export pplb set protocols bgp group to-RR type internal set protocols bgp group to-RR local-address 192.168.255.10 set protocols bgp group to-RR neighbor 192.168.255.12 family inet unicast set protocols bgp group to-RR neighbor 192.168.255.12 family inet-vpn unicast per-prefix-label set protocols mpls traffic-engineering set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf spf-options microloop-avoidance post-convergence-path delay 60000 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-labels 5 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols ospf backup-spf-options use-source-packet-routing set protocols ospf source-packet-routing prefix-segment prefix-sid set protocols ospf source-packet-routing node-segment ipv4-index 0 set protocols ospf source-packet-routing srgb start-label 800000 set protocols ospf source-packet-routing srgb index-range 80000 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 post-convergence-lfa node-protection
设备 R1
set interfaces xe-0/0/0:0 description To_R0 set interfaces xe-0/0/0:0 unit 0 family inet address 10.10.1.2/30 set interfaces xe-0/0/0:0 unit 0 family mpls set interfaces xe-0/0/0:2 description To_R2 set interfaces xe-0/0/0:2 unit 0 family inet address 10.10.12.1/30 set interfaces xe-0/0/0:2 unit 0 family mpls set interfaces xe-0/0/0:2 unit 1 family inet address 10.11.12.1/30 set interfaces xe-0/0/0:2 unit 1 family mpls set interfaces xe-0/0/0:3 description to_R4 set interfaces xe-0/0/0:3 unit 0 family inet address 10.10.14.1/30 set interfaces xe-0/0/0:3 unit 0 family mpls set interfaces xe-0/0/1:0 description to_R5 set interfaces xe-0/0/1:0 unit 0 family inet address 10.10.15.1/30 set interfaces xe-0/0/1:0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.255.11/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement prefix-sid term 1 from route-filter 192.168.255.11/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1001 set policy-options policy-statement prefix-sid term 1 then prefix-segment node-segment set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 192.168.255.11 set routing-options autonomous-system 65000 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf spf-options microloop-avoidance post-convergence-path delay 60000 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-labels 5 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols ospf backup-spf-options use-source-packet-routing set protocols ospf source-packet-routing prefix-segment prefix-sid set protocols ospf source-packet-routing node-segment ipv4-index 2 set protocols ospf source-packet-routing srgb start-label 800000 set protocols ospf source-packet-routing srgb index-range 80000 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 post-convergence-lfa set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 post-convergence-lfa set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 post-convergence-lfa set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.1 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.1 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 post-convergence-lfa set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.1 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.1 metric 10
设备 R2
set interfaces xe-0/0/0:1 description To_R1 set interfaces xe-0/0/0:1 unit 0 family inet address 10.10.12.2/30 set interfaces xe-0/0/0:1 unit 0 family mpls set interfaces xe-0/0/0:1 unit 1 family inet address 10.11.12.2/30 set interfaces xe-0/0/0:1 unit 1 family inet6 set interfaces xe-0/0/0:1 unit 1 family mpls set interfaces xe-0/0/0:2 description To_R3 set interfaces xe-0/0/0:2 unit 0 family inet address 10.10.23.1/30 set interfaces xe-0/0/0:2 unit 0 family mpls set interfaces xe-0/0/0:3 description To_R4 set interfaces xe-0/0/0:3 unit 0 family inet address 10.10.24.1/30 set interfaces xe-0/0/0:3 unit 0 family mpls set interfaces xe-0/0/1:0 description To_R5 set interfaces xe-0/0/1:0 unit 0 family inet address 10.10.25.1/30 set interfaces xe-0/0/1:0 unit 0 family mpls set interfaces xe-0/0/1:1 description To_R6 set interfaces xe-0/0/1:1 unit 0 family inet address 10.10.26.1/30 set interfaces xe-0/0/1:1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.255.12/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement prefix-sid term 1 from route-filter 192.168.255.12/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1002 set policy-options policy-statement prefix-sid term 1 then prefix-segment node-segment set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 192.168.255.12 set routing-options autonomous-system 65000 set routing-options forwarding-table export pplb set protocols bgp group to-RR type internal set protocols bgp group to-RR local-address 192.168.255.12 set protocols bgp group to-RR neighbor 192.168.255.17 family inet unicast set protocols bgp cluster 192.168.255.12 set protocols mpls traffic-engineering set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf spf-options microloop-avoidance post-convergence-path delay 60000 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-labels 5 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 protocols ospf backup-spf-options use-source-packet-routing set protocols ospf source-packet-routing prefix-segment prefix-sid set protocols ospf source-packet-routing node-segment ipv4-index 4 set protocols ospf source-packet-routing srgb start-label 800000 set protocols ospf source-packet-routing srgb index-range 80000 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/1:1.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/1:1.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/1:1.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.1 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.1 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.2 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.2 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.3 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.3 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.4 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.4 metric 10
设备 R3
set interfaces xe-0/0/0:0 description To_R2 set interfaces xe-0/0/0:0 unit 0 family inet address 10.10.23.2/30 set interfaces xe-0/0/0:0 unit 0 family mpls set interfaces xe-0/0/0:1 description To_R5 interfaces xe-0/0/0:1 unit 0 family inet address 10.10.35.2/30 set interfaces xe-0/0/0:1 unit 0 family mpls set interfaces xe-0/0/0:2 description To_R6 set interfaces xe-0/0/0:2 unit 0 family inet address 10.10.36.1/30 set interfaces xe-0/0/0:2 unit 0 family mpls set interfaces xe-0/0/0:3 description To_R7 set interfaces xe-0/0/0:3 unit 0 family inet address 10.10.37.1/30 set interfaces xe-0/0/0:3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.255.13/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement prefix-sid term 1 from route-filter 192.168.255.13/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1003 set policy-options policy-statement prefix-sid term 1 then prefix-segment node-segment set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 192.168.255.13 set routing-options autonomous-system 65000 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf spf-options microloop-avoidance post-convergence-path delay 60000 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-labels 5 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols ospf backup-spf-options use-source-packet-routing set protocols ospf source-packet-routing prefix-segment prefix-sid set protocols ospf source-packet-routing node-segment ipv4-index 6 set protocols ospf source-packet-routing srgb start-label 800000 set protocols ospf source-packet-routing srgb index-range 80000 protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 post-convergence-lfa node-protection
设备 R4
set interfaces xe-0/0/0:0 description To_R0 set interfaces xe-0/0/0:0 unit 0 family inet address 10.10.4.2/30 set interfaces xe-0/0/0:0 unit 0 family mpls set interfaces xe-0/0/0:2 description To_R2 set interfaces xe-0/0/0:2 unit 0 family inet address 10.10.24.2/30 set interfaces xe-0/0/0:2 unit 0 family mpls set interfaces xe-0/0/0:3 description To_R1 set interfaces xe-0/0/0:3 unit 0 family inet address 10.10.14.2/30 set interfaces xe-0/0/0:3 unit 0 family mpls set interfaces xe-0/0/1:0 description To_R5 set interfaces xe-0/0/1:0 unit 0 family inet address 10.10.45.1/30 set interfaces xe-0/0/1:0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.255.14/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement prefix-sid term 1 from route-filter 192.168.255.14/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1004 set policy-options policy-statement prefix-sid term 1 then prefix-segment node-segment set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 192.168.255.14 set routing-options forwarding-table export pplb set routing-options autonomous-system 65000 set protocols mpls traffic-engineering set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf spf-options microloop-avoidance post-convergence-path delay 60000 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-labels 5 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols ospf backup-spf-options use-source-packet-routing set protocols ospf source-packet-routing prefix-segment prefix-sid set protocols ospf source-packet-routing node-segment ipv4-index 8 set protocols ospf source-packet-routing srgb start-label 800000 set protocols ospf source-packet-routing srgb index-range 80000 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 post-convergence-lfa node-protection
设备 R5
set interfaces xe-0/0/0:1 description To_R1 set interfaces xe-0/0/0:1 unit 0 family inet address 10.10.15.2/30 set interfaces xe-0/0/0:1 unit 0 family mpls set interfaces xe-0/0/0:2 description To_R2 set interfaces xe-0/0/0:2 unit 0 family inet address 10.10.25.2/30 set interfaces xe-0/0/0:2 unit 0 family mpls set interfaces xe-0/0/0:3 description To_R3 set interfaces xe-0/0/0:3 unit 0 family inet address 10.10.35.2/30 set interfaces xe-0/0/0:3 unit 0 family mpls set interfaces xe-0/0/1:0 description To_R4 set interfaces xe-0/0/1:0 unit 0 family inet address 10.10.45.2/30 set interfaces xe-0/0/1:0 unit 0 family mpls set interfaces xe-0/0/1:1 description To_R6 set interfaces xe-0/0/1:1 unit 0 family inet address 10.10.56.1/30 set interfaces xe-0/0/1:1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.255.15/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement prefix-sid term 1 from route-filter 192.168.255.15/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1005 set policy-options policy-statement prefix-sid term 1 then prefix-segment node-segment set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 192.168.255.15 set routing-options autonomous-system 65000 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf spf-options microloop-avoidance post-convergence-path delay 60000 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-labels 5 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols ospf backup-spf-options use-source-packet-routing set protocols ospf source-packet-routing node-segment ipv4-index 10 set protocols ospf source-packet-routing srgb start-label 800000 set protocols ospf source-packet-routing srgb index-range 80000 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/1:0.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/1:1.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/1:1.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/1:1.0 post-convergence-lfa node-protection
设备 R6
set interfaces xe-0/0/0:0 description To_R2 set interfaces xe-0/0/0:0 unit 0 family inet address 10.10.26.2/30 set interfaces xe-0/0/0:0 unit 0 family mpls set interfaces xe-0/0/0:1 description To_R3 set interfaces xe-0/0/0:1 unit 0 family inet address 10.10.36.2/30 set interfaces xe-0/0/0:1 unit 0 family mpls set interfaces xe-0/0/0:2 description To_R5 set interfaces xe-0/0/0:2 unit 0 family inet filter output v4filter set interfaces xe-0/0/0:2 unit 0 family inet address 10.10.56.2/30 set interfaces xe-0/0/0:2 unit 0 family mpls filter output mplsfilter set interfaces xe-0/0/0:3 description To_R7 set interfaces xe-0/0/0:3 unit 0 family inet address 10.10.67.1/30 set interfaces xe-0/0/0:3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.255.16/32 set interfaces lo0 unit 0 family inet address 192.168.255.61/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement prefix-sid term 1 from route-filter 192.168.255.16/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1006 set policy-options policy-statement prefix-sid term 1 then prefix-segment node-segment set policy-options policy-statement prefix-sid term 1 then accept set policy-options policy-statement prefix-sid term 2 from route-filter 192.168.255.61/32 exact set policy-options policy-statement prefix-sid term 2 then prefix-segment index 1106 set policy-options policy-statement prefix-sid term 2 then accept set firewall family inet filter v4filter term t1 from destination-address 8.3.0.0/16 set firewall family inet filter v4filter term t1 then accept set firewall family inet filter v4filter term t6 then accept set firewall family mpls filter mplsfilter term t1 from ip-version ipv4 destination-address 10.8.0.1/16 set firewall family mpls filter mplsfilter term t1 then count v4sr-nsid-cnt set firewall family mpls filter mplsfilter term t1 then accept set firewall family mpls filter mplsfilter term t2 from ip-version ipv4 destination-address 10.9.0.1/16 set firewall family mpls filter mplsfilter term t2 then count v4sr-psid-cnt set firewall family mpls filter mplsfilter term t2 then accept set firewall family mpls filter mplsfilter term t3 then accept set firewall family mpls filter mplsfilter term t4 then accept set firewall family mpls filter mplsfilter term t6 then accept set routing-options router-id 192.168.255.16 set routing-options autonomous-system 65000 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf spf-options microloop-avoidance post-convergence-path delay 60000 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-labels 5 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols ospf backup-spf-options use-source-packet-routing set protocols ospf source-packet-routing prefix-segment prefix-sid set protocols ospf source-packet-routing node-segment ipv4-index 12 set protocols ospf source-packet-routing srgb start-label 800000 set protocols ospf source-packet-routing srgb index-range 80000 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:2.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 metric 110 set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 metric 100 set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 post-convergence-lfa node-protection
设备 R7
set interfaces xe-0/0/0:0 description To_R3 set interfaces xe-0/0/0:0 unit 0 family inet address 10.10.37.2/24 set interfaces xe-0/0/0:0 unit 0 family mpls set interfaces xe-0/0/0:1 description To_R6 set interfaces xe-0/0/0:1 unit 0 family inet address 10.10.67.2/30 set interfaces xe-0/0/0:1 unit 0 family mpls set interfaces xe-0/0/0:2 description to_CE2 set interfaces xe-0/0/0:2 unit 4 family inet address 172.16.20.1/30 set interfaces xe-0/0/0:2 unit 4 family mpls set interfaces lo0 unit 0 family inet address 192.168.255.17/32 set interfaces lo0 unit 0 family inet address 192.168.255.71/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement payload_9 term 1 from route-filter 10.7.0.1/16 orlonger set policy-options policy-statement payload_9 term 1 then next-hop 192.168.255.17 set policy-options policy-statement payload_9 term 1 then accept set policy-options policy-statement payload_9 term 2 from route-filter 10.8.0.1/16 orlonger set policy-options policy-statement payload_9 term 2 then next-hop 192.168.255.17 set policy-options policy-statement payload_9 term 2 then accept set policy-options policy-statement payload_9 term 3 from route-filter 8.2.0.0/16 orlonger set policy-options policy-statement payload_9 term 3 then next-hop 192.168.255.71 set policy-options policy-statement payload_9 term 4 then reject set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement prefix-sid term 1 from route-filter 192.168.255.17/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1007 set policy-options policy-statement prefix-sid term 1 then prefix-segment node-segment set policy-options policy-statement prefix-sid term 1 then accept set policy-options policy-statement prefix-sid term 2 from route-filter 192.168.255.71/32 exact set policy-options policy-statement prefix-sid term 2 then prefix-segment index 1107 set policy-options policy-statement prefix-sid term 2 then accept set policy-options policy-statement v4stat term 1 from protocol static set policy-options policy-statement v4stat term 1 from route-filter 100.100.100.1/32 orlonger set policy-options policy-statement v4stat term 1 then accept set policy-options policy-statement v4_prefixes term 1 from route-filter 8.3.0.0/16 orlonger set policy-options policy-statement v4_prefixes term 1 then accept set policy-options policy-statement v4_prefixes term 3 then reject set routing-options rib inet.0 static route 100.100.100.1/32 receive set routing-options router-id 192.168.255.17 set routing-options autonomous-system 65000 set routing-options forwarding-table export pplb set protocols bgp group to-RR type internal set protocols bgp group to-RR local-address 192.168.255.17 set protocols bgp group to-RR neighbor 192.168.255.12 family inet unicast set protocols bgp group to-RR neighbor 192.168.255.12 export payload_9 set protocols bgp group to-CE1 type external set protocols bgp group to-CE1 local-address 172.16.20.1 set protocols bgp group to-CE1 neighbor 172.16.20.2 family inet unicast set protocols bgp group to-CE1 neighbor 172.16.20.2 peer-as 700 set protocols bgp group to-CE1 neighbor 172.16.20.2 local-as 100 set protocols mpls traffic-engineering set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf backup-spf-options use-post-convergence-lfa maximum-labels 5 set protocols ospf backup-spf-options use-post-convergence-lfa maximum-backup-paths 8 set protocols ospf backup-spf-options use-source-packet-routing set protocols ospf source-packet-routing prefix-segment prefix-sid set protocols ospf source-packet-routing node-segment ipv4-index 14 set protocols ospf source-packet-routing srgb start-label 800000 set protocols ospf source-packet-routing srgb index-range 80000 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 post-convergence-lfa node-protection set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 interface-type p2p set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/0/0:1.0 post-convergence-lfa node-protection
配置设备 R0
分步过程
要在 OSPFv2 网络中配置分段路由微环路避免路径,请在 R0 设备上执行以下步骤:
-
配置设备接口以启用 IP 和 MPLS 传输。
[edit] user@R0#set interfaces xe-0/0/0:0 description To_R1 user@R0#set interfaces xe-0/0/0:0 unit 0 family inet address 10.10.1.1/30 uesr@R0#set interfaces xe-0/0/0:0 unit 0 family mpls user@R0#set interfaces xe-0/0/0:3 description To_R4 user@R0#set interfaces xe-0/0/0:3 unit 0 family inet address 10.10.4.1/30 uesr@R0#set interfaces xe-0/0/0:3 unit 0 family mpls user@R0#set interfaces xe-0/0/1:2 description to_CE1 user@R0#set interfaces xe-0/0/1:2 unit 1 family inet address 172.16.10.2/30 user@R0#set interfaces xe-0/0/1:2 unit 1 family mpls
-
配置用作 OSPF 会话的路由器 ID 的环路接口 (lo0) 地址。
[edit] user@R0#set interfaces lo0 unit 0 family inet address 192.168.255.10/32 user@R0#set interfaces lo0 unit 0 family inet address 192.168.255.18/32
-
配置路由器 ID 和自治系统 (AS) 编号,以便在属于同一 AS 的一组路由设备中传播路由信息。
[edit] user@R0#set routing-options router-id 192.168.255.10 user@R0#set routing-options autonomous-system 65000
-
定义用于对数据包进行负载平衡的策略,并应用每个数据包的策略以启用流量的负载平衡。
[edit] user@R0#set policy-options policy-statement pplb then load-balance per-packet user@R0#set routing-options forwarding-table export pplb
-
配置 R0 以通告环路地址。该
prefix-segment index
选项为每个路由器的环路设置基本标签。在此示例中,基索引设置为反映|路由器编号。因此,R0 使用 1000。[edit] user@R0#set policy-options policy-statement prefix-sid term 1 from route-filter 192.168.255.10/32 exact user@R0#set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1000 user@R0#set policy-options policy-statement prefix-sid term 1 then prefix-segment node-segment user@R0#set policy-options policy-statement prefix-sid term 1 then accept
-
在所有接口(管理接口除外)上配置 MPLS。同时启用流量工程。
[edit] user@R0#set protocols mpls interface all user@R0#set protocols mpls interface fxp0.0 disable user@R0#set protocols mpls traffic-engineering
-
配置 MPLS 标签范围,为链路分配静态标签。
[edit] user@R0#set protocols mpls label-range static-label-range 60001 100000
-
在 R0 和路由反射器 R2 之间配置 BGP 对等互连。配置单播网络层可访问性信息 (NRLI),为设备上的每个前缀分配唯一标签。
[edit] user@R0#set protocols bgp group to-RR type internal user@R0#set protocols bgp group to-RR local-address 192.168.255.10 user@R0#set protocols bgp group to-RR neighbor 192.168.255.12 family inet unicast user@R0#set protocols bgp group to-RR neighbor 192.168.255.12 family inet-vpn unicast per-prefix-label
-
配置 TI-LFA 以启用针对链路和节点故障的保护。使用 TI-LFA 的 SR 可在主路径发生故障或不可用时,将流量立即路由到备用路径或备用路径,从而更快地恢复网络连接。
[edit] user@host#set protocols ospf backup-spf-options use-source-packet-routing
-
对于 OSPFv2 协议,将备份最短路径优先 (SPF) 属性配置为 8,例如最大等价多路径 (ECMP) 为 8,最大标签数配置为 5。
[edit] user@host#set protocols ospf backup-spf-options use-post-convergence-lfa maximum-labels 5 user@host#set protocols ospf backup-spf-options use-post-convergence-lfa maximum-backup-paths 8
-
为 OSPFv2 协议在 SPRING 中配置前缀分段属性、开始标签和分段路由全局块 (SRGB) 的索引范围。
[edit] user@host#set protocols ospf source-packet-routing prefix-segment prefix-sid user@host#set protocols ospf source-packet-routing node-segment ipv4-index 0 user@host#set protocols ospf source-packet-routing srgb start-label 800000 user@host#set protocols ospf source-packet-routing srgb index-range 80000
-
将环路接口配置为被动接口,以确保协议不会在环路接口上运行,并确保环路接口在整个网络中正确播发。
[edit] user@host#set protocols ospf area 0.0.0.0 interface lo0.0 passive
-
在设备 R0 的点对点接口上配置 OSPF 区域 0。
[edit] user@host#set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 interface-type p2p user@host#set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 metric 10 user@host#set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 interface-type p2p user@host#set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 metric 10
-
在 OSPFv2 协议的给定区域和接口上配置遵循收敛后路径的备份路径的计算和安装。还可以在遵循融合后路径的这些接口上启用节点链路保护。
[edit] user@host#set protocols ospf area 0.0.0.0 interface xe-0/0/0:0.0 post-convergence-lfa node-protection user@host#set protocols ospf area 0.0.0.0 interface xe-0/0/0:3.0 post-convergence-lfa node-protection
-
配置微环路避免,为可能受微环路影响的路由临时安装收敛后路径,并为 OSPFv2 协议指定 60000 毫秒的延迟时间段。延迟计时器过期后,临时路径将还原为目标的节点 SID。
[edit] user@host#set protocols ospf spf-options microloop-avoidance post-convergence-path delay 60000
结果
检查配置结果:
interfaces { xe-0/0/0:0 { description To_R1; unit 0 { family inet { address 10.10.1.1/30; } family mpls; } } xe-0/0/0:3 { description To_R4; unit 0 { family inet { address 10.10.4.1/30; } family mpls; } } xe-0/0/1:2 { description to_CE1; unit 1 { family inet { address 172.16.10.2/30; } family mpls; } } } lo0 { unit 0 { family inet { address 192.168.255.10/32; address 192.168.255.18/32; } family mpls; } } } policy-options { policy-statement pplb { then { load-balance per-packet; } } policy-statement prefix-sid { term 1 { from { route-filter 192.168.255.10/32 exact; } then { prefix-segment { index 1000; node-segment; } accept; } } term 2 { from { route-filter 192.168.255.18/32 exact; } then { prefix-segment { index 1100; } accept; } } } } routing-options { router-id 192.168.255.10; autonomous-system 100; forwarding-table { export pplb; } } protocols { bgp { group to-RR { type internal; local-address 192.168.255.10; neighbor 192.168.255.12 { family inet { unicast; } family inet-vpn { unicast { per-prefix-label; } } } } } mpls { traffic-engineering; label-range { static-label-range 60001 100000; } interface all; interface fxp0.0 { disable; } } ospf { spf-options { microloop-avoidance { post-convergence-path { delay 60000; } } } backup-spf-options { use-post-convergence-lfa { maximum-labels 5; maximum-backup-paths 8; } use-source-packet-routing; } source-packet-routing { prefix-segment prefix-sid; node-segment ipv4-index 0; srgb start-label 800000 index-range 80000; } area 0.0.0.0 { interface lo0.0 { passive; } interface xe-0/0/0:0.0 { interface-type p2p; metric 10; post-convergence-lfa; } interface xe-0/0/0:3.0 { interface-type p2p; metric 10; post-convergence-lfa; } } } }
验证
确认配置工作正常。
以下部分介绍链路关闭事件的微循环避免。
- 在禁用 R0 和 R1 之间的链路之前,验证 R0 和 R7 之间的连接
- 验证是否禁用了 R0 和 R1 之间的链路
- 验证在禁用链路后为目标安装的微环路避免路径
- 使用微环路验证数据包
- 验证延迟计时器到期后微环避免路径是否更改为收敛后路径
- 验证 R0 和 R7 之间的连接
- 启用链路后,验证路径是否更改为微环避免路径
在禁用 R0 和 R1 之间的链路之前,验证 R0 和 R7 之间的连接
目的
验证设备 R0 是否可以到达设备 R7 上的目标。
行动
在操作模式下, ping 在设备 R0 上运行命令。
user@R0>ping 192.168.255.17 PING 192.168.255.17 (192.168.255.17): 56 data bytes 64 bytes from 192.168.255.17: icmp_seq=0 ttl=61 time=41.493 ms 64 bytes from 192.168.255.17: icmp_seq=1 ttl=61 time=57.242 ms 64 bytes from 192.168.255.17: icmp_seq=2 ttl=61 time=44.977 ms 64 bytes from 192.168.255.17: icmp_seq=3 ttl=61 time=202.092 ms 64 bytes from 192.168.255.17: icmp_seq=4 ttl=61 time=60.495 ms 64 bytes from 192.168.255.17: icmp_seq=5 ttl=61 time=39.396 ms 64 bytes from 192.168.255.17: icmp_seq=6 ttl=61 time=79.993 ms 64 bytes from 192.168.255.17: icmp_seq=7 ttl=61 time=78.741 ms 8 packets transmitted, 8 received, 0% packet loss, time 7007ms rtt min/avg/max/mdev = 38.194/47.998/60.879/8.727 ms
意义
这些结果证实设备 R0 可以访问 OSPFv2 网络中的设备 R7。
验证是否禁用了 R0 和 R1 之间的链路
目的
要验证是否在设备 R0 上禁用了 R0 和 R1 之间的链路
行动
在配置模式下, disable interface 在设备 R0 上运行命令
user@R0#disble interface xe-0/0/0:0
要验证链路是否已禁用,请在操作模式下在 show interfaces 设备 R0 上运行命令
user@R0>show interfaces xe-0/0/0:0 Physical interface: xe-0/0/0:0, Administratively down, Physical link is Down Interface index: 149, SNMP ifIndex: 527 Description: To_R1_1 Link-level type: Ethernet, MTU: 1518, MRU: 1526, LAN-PHY mode, Speed: 10Gbps, BPDU Error: None, Loop Detect PDU Error: None, MAC-REWRITE Error: None, Loopback: None, Source filtering: Disabled, Flow control: Enabled, Speed Configuration: Auto Pad to minimum frame size: Disabled Device flags : Present Running Down Interface flags: Hardware-Down Down SNMP-Traps Internal: 0x4000 CoS queues : 8 supported, 8 maximum usable queues Schedulers : 0 Current address: 2c:6b:f5:42:fe:00, Hardware address: 2c:6b:f5:42:fe:00 Last flapped : 2022-02-15 09:53:51 PST (00:00:10 ago) Input rate : 0 bps (0 pps) Output rate : 0 bps (0 pps) Active alarms : None Active defects : None PCS statistics Seconds Bit errors 0 Errored blocks 0 Link Degrade : Link Monitoring : Disable Interface transmit statistics: Disabled
意义
输出指示 R0 和 R1 之间的物理链路已禁用,并且在管理上已关闭。
验证在禁用链路后为目标安装的微环路避免路径
目的
通过验证 inet.3 表中的路由和 mpls.0 表中的路由标签详细信息,验证当 R0 和 R1 之间的链路被禁用时,从 R0 为目标路由 R7 安装的微环回避路径。
行动
在操作模式下, show route table inet.3 在设备 R0 上运行命令。
user@R0>show route table inet.3 192.168.255.17/32 inet.3: 25 destinations, 26 routes (25 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 192.168.255.17/32 *[L-OSPF/10/5] 00:00:31, metric 130 > to 192.168.255.14 via xe-0/0/0:3, Push 16, Push 801006(top)
在操作模式下, show route label label value protocol ospf extensive 在设备 R0 上运行命令。
user@R0>show route label 801007 protocol ospf extensive mpls.0: 23 destinations, 23 routes (23 active, 0 holddown, 0 hidden) 801007 (1 entry, 1 announced) TSI: KRT in-kernel 801007 /52 -> {Swap 16, Push 801006 (top)} *L-OSPF Preference: 10/5 Next hop type: Router, Next hop index: 649 Address: 0x7a1ed58 Next-hop reference count: 4, key opaque handle: 0x0 Next hop: 10.10.4.2 via xe-0/0/0:3.0 weight 0x1, selected Label operation: Swap 16, Push 801006(top) Load balance label: Label 16: None; Label 801006: None Label element ptr: 0x8fd6ed0 Label parent element ptr: 0x0 Label element references: 1 Label element child references: 0 Label element lsp id: 0 Session Id: 321 State: <Active Int> Local AS: 100 Age: 2:55:13 Metric: 130 Validation State: unverified Area: 0.0.0.0 Task: OSPF Announcement bits (1): 1-KRT AS path: I Thread: junos-main
意义
输出表明,当 R0 和 R1 之间的链路断开时,将为 R7 安装从 R0 到 R4 的微环避免路径,直到延迟计时器到期。
使用微环路验证数据包
目的
使用防火墙计数器信息通过微环路验证数据包
行动
在操作模式下, show firewall 在设备 R6 上运行命令。
user@R6>show firewall Filter: mplsfilter Counters: Name Bytes Packets v4sr-nsid-cnt 0 0 v4sr-psid-cnt 0 0
意义
输出显示设备 R6 上配置的 mplsfilter 以显示微循环(如果有)。值 0 表示没有带有微环路的数据包。
验证延迟计时器到期后微环避免路径是否更改为收敛后路径
目的
验证在延迟计时器 60000 毫秒到期后,为目标路由 R7 安装的微环路避免路径从 R0 更改为收敛后路径。
行动
在操作模式下, show route table inet.3 在设备 R0 上运行命令。
user@R0>show route table inet.3 192.168.255.17/32 inet.3: 25 destinations, 26 routes (25 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 192.168.255.17/32 *[L-OSPF/10/5] 00:00:31, metric 130 > to 192.168.255.14 via xe-0/0/0:3, Push 801007
在操作模式下, show route label label value protocol ospf extensive 在设备 R0 上运行命令。
user@R0>show route label 801007 protocol ospf extensive mpls.0: 23 destinations, 23 routes (23 active, 0 holddown, 0 hidden) 801007 (1 entry, 1 announced) TSI: KRT in-kernel 801007 /52 -> {Swap 801007} *L-OSPF Preference: 10/5 Next hop type: Router, Next hop index: 615 Address: 0x7a1c400 Next-hop reference count: 4, key opaque handle: 0x0 Next hop: 10.10.4.2 via xe-0/0/0:3.0 weight 0x1, selected Label operation: Swap 801007 Load balance label: Label 801007: None; Label element ptr: 0x8fd6458 Label parent element ptr: 0x0 Label element references: 1 Label element child references: 0 Label element lsp id: 0 Session Id: 321 State: <Active Int> Local AS: 100 Age: 2:55:13 Metric: 130 Validation State: unverified Area: 0.0.0.0 Task: OSPF Announcement bits (1): 1-KRT AS path: I Thread: junos-main
意义
输出表明,在延迟定时器到期后,微环避免路径更改为收敛后路径。
验证 R0 和 R7 之间的连接
目的
验证设备 R0 是否可以到达设备 R7 上的目标。
行动
在操作模式下, ping 在设备 R0 上运行命令。
user@R0>ping 192.168.255.17 PING 192.168.255.17 (192.168.255.17): 56 data bytes 64 bytes from 192.168.255.17: icmp_seq=0 ttl=61 time=41.493 ms 64 bytes from 192.168.255.17: icmp_seq=1 ttl=61 time=57.242 ms 64 bytes from 192.168.255.17: icmp_seq=2 ttl=61 time=44.977 ms 64 bytes from 192.168.255.17: icmp_seq=3 ttl=61 time=202.092 ms 64 bytes from 192.168.255.17: icmp_seq=4 ttl=61 time=60.495 ms 64 bytes from 192.168.255.17: icmp_seq=5 ttl=61 time=39.396 ms 64 bytes from 192.168.255.17: icmp_seq=6 ttl=61 time=79.993 ms 64 bytes from 192.168.255.17: icmp_seq=7 ttl=61 time=78.741 ms 8 packets transmitted, 8 received, 0% packet loss, time 7007ms rtt min/avg/max/mdev = 38.194/47.998/60.879/8.727 ms
意义
这些结果证实,设备 R0 可以到达 OSPFv2 网络中的设备 R7,并且由于配置了微环避免路径,在链路关闭的情况量流出的数据包丢失率为 0%。
启用链路后,验证路径是否更改为微环避免路径
目的
验证在 R0 和 R1 之间启用链路时,目标的路径是否更改为微环避免路径。
行动
在操作模式下, show route table inet.3 在设备 R0 上运行命令。
user@R0>show route table inet.3 192.168.255.17/32 inet.3: 26 destinations, 27 routes (26 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 192.168.255.17/32 *[L-OSPF/10/5] 00:02:05, metric 40 > to 192.168.255.11 via xe-0/0/0:0, Push 801007 to 192.168.255.14 via xe-0/0/0:3, Push 16, Push 801006(top)
在操作模式下, show route label label value protocol ospf extensive 在设备 R0 上运行命令。
user@R0>show route label 801007 protocol ospf extensive mpls.0: 23 destinations, 23 routes (23 active, 0 holddown, 0 hidden) 801007 (1 entry, 1 announced) TSI: KRT in-kernel 801007 /52 -> {list:Swap 801007, Swap 16, Push 801006(top)} *L-OSPF Preference: 10/5 Next hop type: Router, Next hop index: 615 Address: 0x79329ac Next-hop reference count: 3, key opaque handle: 0x0 Next hop: 10.10.4.2 via xe-0/0/0:3.0 weight 0x1, selected Label operation: Push 801007 Load balance label: Label 801007: None; Label element ptr: 0x8fd6458 Label parent element ptr: 0x0 Label element references: 1 Label element child references: 0 Label element lsp id: 0 Session Id: 0 Next hop: 10.10.1.2 via xe-0/0/0:0.0 weight 0xf000, selected Label operation: Swap 16, Push 801006(top) Load balance label: Label 16: None; Label 801006: None; Label element ptr: 0x8fd8e60 Label parent element ptr: 0x0 Label element references: 1 Label element child references: 0 Label element lsp id: 0 Session Id: 0 State: <Active Int> Local AS: 100 Age: 2:55:13 Metric: 40 Validation State: unverified Area: 0.0.0.0 Task: OSPF Announcement bits (1): 1-KRT AS path: I Thread: junos-main
意义
输出显示从 R0 到目标 R7 的路由,其中包括微环回避路径和 R0 和 R7 之间启用链路后的收敛后路径。