如何在 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 分段路由网络中为本地和远程网络事件(包括链路关闭、链路上行和指标更改)配置微环避免,请在[edit protocols ospf spf-options microloop avoidance post-convergence-path]层次结构级别包含maximum-labelsdelay milliseconds语句。为了有效地避免微环路,请在网络中的所有节点上配置此功能。
微环路避免不能替代 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 配置为一个 IPv4 路由反射器,其 IBGP 对等会话到 R0 和 R7。在此示例中,没有其他路由器使用 BGP。设备 R6 配置了防火墙过滤器,以检测链路关闭事件后带有微环的数据包(如果有)。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到 [编辑] 层次结构级别的 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选项可为每个路由器的环路设置基本标签。在此示例中,基数索引设置为 reflect|路由器编号。因此,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
-
将备份最短路径优先 (SPF) 属性(如最大等价多路径 (ECMP) 配置为 8,将 OSPFv2 协议的 TI-LFA 的最大标签数配置为 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
-
在 SPRING 中为 OSPFv2 协议配置分段路由全局块 (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 上的目标。
行动
在作模式下,在设备 R0 上运行 ping 命令。
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 之间的链路
行动
在配置模式下,在设备 R0 上运行 disable interface 命令
user@R0#disble interface xe-0/0/0:0
要验证链路是否已禁用,请在作模式下对设备 R0 运行 show interfaces 命令
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 安装的微环避免路径。
行动
在作模式下,在设备 R0 上运行 show route table inet.3 命令。
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)
在作模式下,在设备 R0 上运行 show route label label value protocol ospf extensive 命令。
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 的微环避免路径,直到延迟计时器到期。
使用微环验证数据包
目的
使用防火墙计数器信息通过微环验证数据包
行动
在作模式下,在设备 R6 上运行 show firewall 命令。
user@R6>show firewall Filter: mplsfilter Counters: Name Bytes Packets v4sr-nsid-cnt 0 0 v4sr-psid-cnt 0 0
意义
输出显示设备 R6 上配置的 mplsfilter 以显示微环(如果有)。值 0 表示没有带有微环的数据包。
验证延迟计时器到期后微环避免路径对收敛后路径的更改
目的
验证为目标路由 R7 安装的微环避免路径,在延迟计时器 60000 毫秒到期后,从 R0 更改为收敛后路径。
行动
在作模式下,在设备 R0 上运行 show route table inet.3 命令。
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
在作模式下,在设备 R0 上运行 show route label label value protocol ospf extensive 命令。
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 上的目标。
行动
在作模式下,在设备 R0 上运行 ping 命令。
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 之间启用链路时,目标的路径是否更改为微环避免路径。
行动
在作模式下,在设备 R0 上运行 show route table inet.3 命令。
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)
在作模式下,在设备 R0 上运行 show route label label value protocol ospf extensive 命令。
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 之间启用链路后的收敛后路径。