为 OSPF 配置无环路备用路由
用于 OSPF 的每前缀环路空闲替代项
在某些拓扑和使用方案中,当多个目标源自同一前缀,并且最佳前缀发起方没有可行的 LFA,而非最佳前缀发起方有一个时。 每前缀 LFA 是一种技术,通过该技术,可以使用非最佳前缀发起方的 LFA 代替最佳前缀发起方的 LFA 来提供本地修复。这也可用于增加 OSPF 协议的本地修复覆盖范围。
每前缀环路自由替代 (LFA) — 无环路备用 (LFA) 是一种技术,通过该技术可将邻接方用作备用下一跃点,以便在主下一跃点(节点或链路)发生故障时为流量提供本地修复路径。为此,基本要求是所选备份邻接方相对于通向目标的主下一跃点提供环路自由路径,从而发起一组内部网关协议 (IGP) 前缀。
以下拓扑说明了每个前缀 LFA 功能适用的部署案例。

ABR1 和 ABR2 是区域边界路由器 (ABR),双宿主到 IPv6 核心网络,该网络通告前缀 10.0.1.0/24 的汇总 LSA,指标为 10。此外,从 PE 路由器的角度来看,ABR1 是 10.0.1.0/24 的最佳前缀发起方。在这种情况下,P2 不是 ABR1 的有效 LFA,因为等价多路径 (ECMP) {P2, PE, P1, ABR1} 和 {P2, ABR2, ABR1} 会导致某些流量通过路由器 PE 环回(无有效 LFA)。但是,对于 ABR2(也是 10.0.1.0/24 的前缀发起方),P2 是有效的 LFA,因为唯一的路径是 {P2, ABR2}。
为 OSPF 配置按前缀的 LFA
每前缀 LFA 是一种机制,通过该机制,可以使用对非最佳前缀发起方的 LFA 代替对最佳前缀发起方的 LFA 以提供本地修复。在这种情况下,可以使用每个前缀的 LFA 来增加 OSPF 协议的本地修复覆盖范围。
无环路备用 (LFA) 是一种机制,通过该机制,可以将邻居用作备份下一跃点,以便在下一主跃点(节点或链路)发生故障时为流量提供本地修复路径。为此,基本要求是所选备份邻接方提供相对于主下一跃点的环路自由路径,该路径指向源自一组 IGP 前缀的目标。在某些拓扑和使用方案中,可能有多个目标源自同一前缀,并且最佳前缀发起方没有可行的 LFA,而非最佳前缀发起方有一个。每前缀 LFA 是一种机制,通过该机制,可以使用对非最佳前缀发起方的 LFA 代替对最佳前缀发起方的 LFA 以提供本地修复。在这种情况下,可以使用每个前缀的 LFA 来增加 OSPF 协议的本地修复覆盖范围。
要为 OSPF 接口配置每个前缀的 LFA,请执行以下操作:
per-prefix-calculation
在[edit protocols (ospf | ospf3) backup-spf-options]
层次结构级别配置配置语句。
OSPF 的无环路备用路由概述
对 OSPF 无环路备用路由的支持实质上增加了 OSPF 的 IP 快速重新路由功能。Junos OS 会预先计算所有 OSPF 路由的无环路备份路由。这些备份路由预安装在数据包转发引擎中,当特定路由的主下一跃点的链接不再可用时,该引擎将执行本地修复并实施备份路径。通过本地修复,数据包转发引擎可以在从路由引擎接收预先计算的路径之前纠正路径故障。本地修复将重新路由流量所需的时间减少到 50 毫秒以内。相比之下,全局修复最多可能需要 800 毫秒才能计算出新路由。本地修复允许使用备份路径继续路由流量,直到全局修复能够计算出新路由。
无环路路径是指不会通过路由设备将流量转发回以到达给定目标的路径。也就是说,首先到达目标的最短路径的邻接方遍历未用作到该目标的备用路由的路由设备。为了确定 OSPF 路由的无环路备用路径,Junos OS 会在每个单跃点邻居上运行最短路径优先 (SPF) 计算。您可以在任何 OSPF 接口上启用对备用无环路路由的支持。由于通常在已启用 OSPF 的接口上启用 LDP,因此此功能还提供对 LDP 标签交换路径 (LSP) 的支持。
如果在为 LDP 和 OSPF 配置的接口上启用对备用无环路路由的支持,则可以使用命令跟踪 traceroute
到主下一跃点的活动路径。
通过 OSPF 路由提供的备份覆盖级别取决于实际网络拓扑,对于任何给定路由设备上的所有目标,通常都低于 100%。您可以扩展备份覆盖范围以包括 RSVP LSP 路径。
Junos OS 通过备用无环路路由为 OSPF 提供三种路由冗余机制:
链路保护 — 提供每链路流量保护。如果您假设只有一个链路可能变得不可用,但主路径上的相邻节点仍可通过另一个接口使用,请使用链路保护。
节点链路保护 — 完全通过不同的路由设备建立备用路径。如果您假定当链接不再可用时,对节点的访问将丢失,请使用节点链接保护。因此,Junos OS 会计算出避免主下一跃点路由设备的备份路径。
每前缀无环路备用 (LFA) — 通过该技术可将邻接方用作备份下一跃点,以便在下一主跃点(节点或链路)发生故障时为流量提供本地修复路径。为此,基本要求是所选备份邻接方相对于通向目标的主下一跃点提供无环路路径,从而产生一组内部网关协议 (IGP) 前缀。
在某些拓扑和使用方案中,可能有多个目标源自同一前缀,并且最佳前缀发起方没有可行的 LFA,而非最佳前缀发起方具有可行的 LFA。 每前缀 LFA 是一种机制,通过该机制,可以使用发往非最佳前缀发起方的 LFA 代替发给最佳前缀发起方的 LFA,以提供本地修复。在这种情况下,可以使用每个前缀的 LFA 来增加 OSPF 协议的本地修复覆盖范围。
在 OSPF 接口上启用链路保护或节点链路保护时,Junos OS 会为遍历受保护接口的所有目标路由创建通往下一跃点主的备用路径。
示例:为 OSPF 配置无环路备用路由
此示例演示如何对启用了 OSPF 的接口使用链路保护。
启用链路保护后,Junos OS 会为遍历受保护接口的所有目标路由创建通往下一主跃点的备用路径。当您假设只有一个链路可能不可用,但相邻节点仍可通过另一个接口使用时,请使用链路保护。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
在此示例中,六个 OSPF 邻接方配置了链路保护。这会导致 Junos OS 为遍历每个受保护接口的所有目标路由创建到下一跃点主的备用路径。此处使用链路保护是因为即使链路不可用,相邻节点仍可通过另一个接口使用。
该示例显示了两种拓扑。一个是默认拓扑,另一个是语音拓扑。有关多拓扑路由的详细信息,请参阅《 多拓扑路由用户指南》。
该示例还包括配置为受保护 OSPF 接口的备份 LSP 的 RSVP LSP。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改与您的网络配置匹配所需的任何详细信息,然后将命令复制并粘贴到层次结构级别的 CLI [edit]
中。
设备 R1
set interfaces so-0/2/2 unit 0 description to-R2 set interfaces so-0/2/2 unit 0 family inet address 192.168.242.1/30 set interfaces so-0/2/2 unit 0 family mpls set interfaces t1-0/1/2 unit 0 description to-R2 set interfaces t1-0/1/2 unit 0 family inet address 192.168.241.1/30 set interfaces t1-0/1/2 unit 0 family mpls set interfaces t1-0/1/0 unit 0 description to-R4 set interfaces t1-0/1/0 unit 0 family inet address 192.168.241.17/30 set interfaces t1-0/1/0 unit 0 family mpls set interfaces so-0/2/0 unit 0 description to-R4 set interfaces so-0/2/0 unit 0 family inet address 192.168.242.17/30 set interfaces so-0/2/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.164.1/32 primary set protocols rsvp interface all link-protection set protocols rsvp interface fxp0.0 disable set protocols mpls label-switched-path path1 backup set protocols mpls label-switched-path path1 to 10.255.164.3 set protocols mpls label-switched-path path2 backup set protocols mpls label-switched-path path2 to 10.255.164.3 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf topology voice topology-id 32 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface so-0/2/0.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/0.0 metric 10 set protocols ospf area 0.0.0.0 interface so-0/2/2.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/2.0 metric 10 set protocols ospf area 0.0.0.0 interface t1-0/1/0.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/1/0.0 metric 10 set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 metric 10 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set policy-options policy-statement pplb then load-balance per-packet set routing-options forwarding-table export pplb set routing-options topologies family inet topology voice set routing-options forwarding-table indirect-next-hop-change-acknowledgements
设备 R2
set interfaces so-0/2/2 unit 0 description to-R1 set interfaces so-0/2/2 unit 0 family inet address 192.168.242.2/30 set interfaces so-0/2/2 unit 0 family mpls set interfaces t1-0/1/2 unit 0 description to-R1 set interfaces t1-0/1/2 unit 0 family inet address 192.168.241.2/30 set interfaces t1-0/1/2 unit 0 family mpls set interfaces so-0/2/0 unit 0 description to-R5 set interfaces so-0/2/0 unit 0 family inet address 192.168.242.21/30 set interfaces so-0/2/0 unit 0 family mpls set interfaces so-0/2/1 unit 0 description to-R3 set interfaces so-0/2/1 unit 0 family inet address 192.168.242.5/30 set interfaces so-0/2/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.164.2/32 primary set protocols rsvp interface all link-protection set protocols rsvp interface fxp0.0 disable set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf topology voice topology-id 32 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface so-0/2/2.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/2.0 metric 10 set protocols ospf area 0.0.0.0 interface so-0/2/0.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/0.0 metric 10 set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 metric 10 set protocols ospf area 0.0.0.0 interface so-0/2/1.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/1.0 metric 10 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set routing-options topologies family inet topology voice set routing-options forwarding-table indirect-next-hop-change-acknowledgements
设备 R3
set interfaces t1-0/1/2 unit 0 description to-R6 set interfaces t1-0/1/2 unit 0 family inet address 192.168.241.25/30 set interfaces t1-0/1/2 unit 0 family mpls set interfaces so-0/2/1 unit 0 description to-R2 set interfaces so-0/2/1 unit 0 family inet address 192.168.242.6/30 set interfaces so-0/2/1 unit 0 family mpls set interfaces so-0/2/0 unit 0 description to-R6 set interfaces so-0/2/0 unit 0 family inet address 192.168.242.25/30 set interfaces so-0/2/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.164.3/32 primary set protocols rsvp interface all link-protection set protocols rsvp interface fxp0.0 disable set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf traceoptions file ospf set protocols ospf traceoptions file size 5m set protocols ospf traceoptions file world-readable set protocols ospf traceoptions flag error set protocols ospf topology voice topology-id 32 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface so-0/2/0.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/0.0 metric 5 set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 metric 10 set protocols ospf area 0.0.0.0 interface so-0/2/1.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/1.0 metric 10 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set routing-options static route 11.3.1.0/24 discard set routing-options static route 11.3.2.0/24 discard set routing-options static route 11.3.3.0/24 discard set routing-options topologies family inet topology voice set routing-options forwarding-table indirect-next-hop-change-acknowledgements
设备 R4
set interfaces t1-0/1/0 unit 0 description to-R1 set interfaces t1-0/1/0 unit 0 family inet address 192.168.241.18/30 set interfaces t1-0/1/0 unit 0 family mpls set interfaces so-0/2/0 unit 0 description to-R1 set interfaces so-0/2/0 unit 0 family inet address 192.168.242.18/30 set interfaces so-0/2/0 unit 0 family mpls set interfaces t1-0/1/2 unit 0 description to-R5 set interfaces t1-0/1/2 unit 0 family inet address 192.168.241.9/30 set interfaces t1-0/1/2 unit 0 family mpls set interfaces so-0/2/2 unit 0 description to-R5 set interfaces so-0/2/2 unit 0 family inet address 192.168.242.9/30 set interfaces so-0/2/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.164.4/32 primary set protocols rsvp interface all link-protection set protocols rsvp interface fxp0.0 disable set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf topology voice topology-id 32 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface t1-0/1/0.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/1/0.0 metric 10 set protocols ospf area 0.0.0.0 interface so-0/2/0.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/0.0 metric 10 set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 metric 10 set protocols ospf area 0.0.0.0 interface so-0/2/2.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/2.0 metric 10 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set routing-options topologies family inet topology voice set routing-options forwarding-table indirect-next-hop-change-acknowledgements
设备 R5
set interfaces t1-0/1/2 unit 0 description to-R4 set interfaces t1-0/1/2 unit 0 family inet address 192.168.241.10/30 set interfaces t1-0/1/2 unit 0 family mpls set interfaces s0-0/2/0 unit 0 description to-R2 set interfaces s0-0/2/0 unit 0 family inet address 192.168.242.22/30 set interfaces s0-0/2/0 unit 0 family mpls set interfaces so-0/2/2 unit 0 description to-R4 set interfaces so-0/2/2 unit 0 family inet address 192.168.242.10/30 set interfaces so-0/2/2 unit 0 family mpls set interfaces so-0/2/1 unit 0 description to-R6 set interfaces so-0/2/1 unit 0 family inet address 192.168.242.13/30 set interfaces so-0/2/1 unit 0 family mpls set interfaces t1-0/2/1 unit 0 description to-R6 set interfaces t1-0/2/1 unit 0 family inet address 192.168.241.13/30 set interfaces t1-0/2/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.164.5/32 primary set protocols rsvp interface all link-protection set protocols rsvp interface fxp0.0 disable set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf topology voice topology-id 32 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface so-0/2/1.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/1.0 metric 5 set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/1/2.0 metric 10 set protocols ospf area 0.0.0.0 interface s0-0/2/0.0 link-protection set protocols ospf area 0.0.0.0 interface s0-0/2/0.0 metric 10 set protocols ospf area 0.0.0.0 interface so-0/2/2.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/2.0 metric 10 set protocols ospf area 0.0.0.0 interface t1-0/2/1.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/2/1.0 metric 10 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set routing-options topologies family inet topology voice set routing-options forwarding-table indirect-next-hop-change-acknowledgements
设备 R6
set interfaces so-0/2/0 unit 0 description to-R5 set interfaces so-0/2/0 unit 0 family inet address 192.168.242.14/30 set interfaces so-0/2/0 unit 0 family mpls set interfaces t1-0/1/0 unit 0 description to-R5 set interfaces t1-0/1/0 unit 0 family inet address 192.168.241.14/30 set interfaces t1-0/1/0 unit 0 family mpls set interfaces t1-0/1/1 unit 0 description to-R3 set interfaces t1-0/1/1 unit 0 family inet address 192.168.241.26/30 set interfaces t1-0/1/1 unit 0 family mpls set interfaces so-0/2/1 unit 0 description to-R3 set interfaces so-0/2/1 unit 0 family inet address 192.168.242.26/30 set interfaces so-0/2/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.164.6/32 primary set protocols rsvp interface all link-protection set protocols rsvp interface fxp0.0 disable set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf topology voice topology-id 32 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface so-0/2/1.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/1.0 metric 5 set protocols ospf area 0.0.0.0 interface so-0/2/0.0 link-protection set protocols ospf area 0.0.0.0 interface so-0/2/0.0 metric 5 set protocols ospf area 0.0.0.0 interface t1-0/1/0.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/1/0.0 metric 10 set protocols ospf area 0.0.0.0 interface t1-0/1/1.0 link-protection set protocols ospf area 0.0.0.0 interface t1-0/1/1.0 metric 10 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set routing-options topologies family inet topology voice set routing-options forwarding-table indirect-next-hop-change-acknowledgements
程序
分步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 R1:
配置设备接口。
[edit interfaces] user@R1# set so-0/2/2 unit 0 description to-R2 user@R1# set so-0/2/2 unit 0 family inet address 192.168.242.1/30 user@R1# set so-0/2/2 unit 0 family mpls user@R1# set t1-0/1/2 unit 0 description to-R2 user@R1# set t1-0/1/2 unit 0 family inet address 192.168.241.1/30 user@R1# set t1-0/1/2 unit 0 family mpls user@R1# set t1-0/1/0 unit 0 description to-R4 user@R1# set t1-0/1/0 unit 0 family inet address 192.168.241.17/30 user@R1# set t1-0/1/0 unit 0 family mpls user@R1# set so-0/2/0 unit 0 description to-R4 user@R1# set so-0/2/0 unit 0 family inet address 192.168.242.17/30 user@R1# set so-0/2/0 unit 0 family mpls user@R1# set lo0 unit 0 family inet address 10.255.164.1/32 primary
扩展备份覆盖范围以包括 RSVP LSP 路径。
[edit protocols rsvp] user@R1# set interface all link-protection user@R1# set interface fxp0.0 disable
在接口上启用 MPLS,并将备份 LSP 配置为设备 R3。
[edit protocols mpls] user@R1# set interface all user@R1# set interface fxp0.0 disable user@R1# set label-switched-path path1 backup user@R1# set label-switched-path path1 to 10.255.164.3 user@R1# set label-switched-path path2 backup user@R1# set label-switched-path path2 to 10.255.164.3
配置 OSPF 连接、链路指标和链路保护。
[edit protocols ospf] user@R1# set traffic-engineering [edit protocols ospf area 0.0.0.0] user@R1# set interface fxp0.0 disable user@R1# set interface lo0.0 passive user@R1# set interface so-0/2/0.0 link-protection user@R1# set interface so-0/2/0.0 metric 10 user@R1# set interface so-0/2/2.0 link-protection user@R1# set interface so-0/2/2.0 metric 10 user@R1# set interface t1-0/1/0.0 link-protection user@R1# set interface t1-0/1/0.0 metric 10 user@R1# set interface t1-0/1/2.0 link-protection user@R1# set interface t1-0/1/2.0 metric 10
(可选)为语音流量配置特定的 OSPF 拓扑。
[edit protocols ospf] user@R1# set topology voice topology-id 32 [edit routing-options topologies family inet] user@R1# set topology voice
在接口上启用 LDP。
[edit protocols ldp] user@R1# set interface all user@R1# set interface fxp0.0 disable
(可选)配置按数据包的负载均衡。
[edit policy-options policy-statement pplb] user@R1# set then load-balance per-packet [edit routing-options forwarding-table] user@R1# set export pplb
配置路由协议进程 (rpd),以便在创建新的转发下一跃点时请求确认。
建议在使用保护机制时配置该
indirect-next-hop-change-acknowledgements
语句。这包括快速重新路由 (FRR) 等 MPLS RSVP 保护,以及内部网关协议 (IGP) 无环路备用 (LFA) 链路或节点保护。[edit routing-options forwarding-table] user@R1# set indirect-next-hop-change-acknowledgements
结果
在配置模式下,输入 show interfaces
、 show protocols
、 show policy-options
和 show routing-options
命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R1# show interfaces so-0/2/2 { unit 0 { description to-R2; family inet { address 192.168.242.1/30; } family mpls; } } t1-0/1/2 { unit 0 { description to-R2; family inet { address 192.168.241.1/30; } family mpls; } } t1-0/1/0 { unit 05 { description to-R4; family inet { address 192.168.241.17/30; } family mpls; } } so-0/2/0 { unit 0 { description to-R4; family inet { address 192.168.242.17/30; } family mpls; } } lo0 { unit 0 { family inet { address 10.255.164.1/32 { primary; } } } }
user@R1# show protocols rsvp { interface all { link-protection; } interface fxp0.0 { disable; } } mpls { label-switched-path path1 { backup; to 10.255.164.3; } label-switched-path path2 { backup; to 10.255.164.3; } interface all; interface fxp0.0 { disable; } } ospf { topology voice topology-id 32; traffic-engineering; area 0.0.0.0 { interface fxp0.0 { disable; } interface lo0.0 { passive; } interface so-0/2/0.0 { link-protection; metric 10; } interface so-0/2/2.0 { link-protection; metric 10; } interface t1-0/1/0.0 { link-protection; metric 10; } interface t1-0/1/2.0 { link-protection; metric 10; } } } ldp { interface all; interface fxp0.0 { disable; } }
user@R1# show policy-options policy-statement pplb { then { load-balance per-packet; } }
user@R1# show routing-options forwarding-table { export pplb; indirect-next-hop-change-acknowledgements; } topologies { family inet { topology voice; } }
如果完成设备配置,请从配置模式输入 commit
。
验证
确认配置工作正常。
验证设备 R1 上的路由
目的
在设备 R1 上,检查路由表中的 OSPF 路由。
行动
user@R1> show route protocol ospf inet.0: 23 destinations, 23 routes (23 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.255.164.2/32 *[OSPF/10] 1d 23:34:00, metric 10 > to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 10.255.164.3/32 *[OSPF/10] 1d 23:34:00, metric 20 > to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 10.255.164.4/32 *[OSPF/10] 1d 23:34:00, metric 10 > to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 10.255.164.5/32 *[OSPF/10] 1d 23:34:00, metric 20 to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 > to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 10.255.164.6/32 *[OSPF/10] 1d 23:34:00, metric 25 to 192.168.242.2 via so-0/2/2.0 > to 192.168.241.2 via t1-0/1/2.0 to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 192.168.241.8/30 *[OSPF/10] 1d 23:34:00, metric 20 > to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 192.168.241.12/30 *[OSPF/10] 1d 23:34:00, metric 30 to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 to 192.168.242.18 via so-0/2/0.0 > to 192.168.241.18 via t1-0/1/0.0 192.168.241.24/30 *[OSPF/10] 1d 23:34:00, metric 30 to 192.168.242.2 via so-0/2/2.0 > to 192.168.241.2 via t1-0/1/2.0 192.168.242.4/30 *[OSPF/10] 1d 23:34:00, metric 20 to 192.168.242.2 via so-0/2/2.0 > to 192.168.241.2 via t1-0/1/2.0 192.168.242.8/30 *[OSPF/10] 1d 23:34:00, metric 20 > to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 192.168.242.12/30 *[OSPF/10] 1d 23:34:00, metric 25 to 192.168.242.2 via so-0/2/2.0 > to 192.168.241.2 via t1-0/1/2.0 to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 192.168.242.20/30 *[OSPF/10] 1d 23:34:00, metric 20 > to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 192.168.242.24/30 *[OSPF/10] 1d 23:34:00, metric 25 to 192.168.242.2 via so-0/2/2.0 > to 192.168.241.2 via t1-0/1/2.0 224.0.0.5/32 *[OSPF/10] 1w1d 02:46:58, metric 1 MultiRecv inet.3: 5 destinations, 6 routes (5 active, 0 holddown, 0 hidden) :voice.inet.0: 22 destinations, 22 routes (22 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.255.164.2/32 *[OSPF/10] 1d 23:34:00, metric 10 > to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 10.255.164.3/32 *[OSPF/10] 1d 23:34:00, metric 20 > to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 10.255.164.4/32 *[OSPF/10] 1d 23:34:00, metric 10 to 192.168.242.18 via so-0/2/0.0 > to 192.168.241.18 via t1-0/1/0.0 10.255.164.5/32 *[OSPF/10] 1d 23:34:00, metric 20 to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 > to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 10.255.164.6/32 *[OSPF/10] 1d 23:34:00, metric 25 to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 > to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 192.168.241.8/30 *[OSPF/10] 1d 23:34:00, metric 20 > to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 192.168.241.12/30 *[OSPF/10] 1d 23:34:00, metric 30 > to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 192.168.241.24/30 *[OSPF/10] 1d 23:34:00, metric 30 to 192.168.242.2 via so-0/2/2.0 > to 192.168.241.2 via t1-0/1/2.0 192.168.242.4/30 *[OSPF/10] 1d 23:34:00, metric 20 to 192.168.242.2 via so-0/2/2.0 > to 192.168.241.2 via t1-0/1/2.0 192.168.242.8/30 *[OSPF/10] 1d 23:34:00, metric 20 to 192.168.242.18 via so-0/2/0.0 > to 192.168.241.18 via t1-0/1/0.0 192.168.242.12/30 *[OSPF/10] 1d 23:34:00, metric 25 to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 > to 192.168.242.18 via so-0/2/0.0 to 192.168.241.18 via t1-0/1/0.0 192.168.242.20/30 *[OSPF/10] 1d 23:34:00, metric 20 to 192.168.242.2 via so-0/2/2.0 > to 192.168.241.2 via t1-0/1/2.0 192.168.242.24/30 *[OSPF/10] 1d 23:34:00, metric 25 > to 192.168.242.2 via so-0/2/2.0 to 192.168.241.2 via t1-0/1/2.0 mpls.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
意义
正如预期的那样,设备 R1 有多个到每个目标的潜在路由。
检查备份覆盖范围
目的
在设备 R1 上,使用 show (ospf | ospf3) backup coverage
命令检查网络中所有节点和前缀可用的备份覆盖范围级别。
行动
user@R1> show ospf backup coverage Topology default coverage: Node Coverage: Area Covered Total Percent Nodes Nodes Covered 0.0.0.0 5 5 100.00% Route Coverage: Path Type Covered Total Percent Routes Routes Covered Intra 17 18 94.44% Inter 0 0 100.00% Ext1 0 0 100.00% Ext2 0 0 100.00% All 17 18 94.44% Topology voice coverage: Node Coverage: Area Covered Total Percent Nodes Nodes Covered 0.0.0.0 5 5 100.00% Route Coverage: Path Type Covered Total Percent Routes Routes Covered Intra 17 18 94.44% Inter 0 0 100.00% Ext1 0 0 100.00% Ext2 0 0 100.00% All 17 18 94.44%
检查备用 LSP
目的
在设备 R1 上,使用 show (ospf | ospf3) backup lsp
命令检查指定为 OSPF 路由备份路由的 LSP。
行动
user@R1> show ospf backup lsp path1 Egress: 10.255.164.3, Status: up, Last change: 01:13:48 TE-metric: 19, Metric: 0 path2 Egress: 10.255.164.3, Status: up, Last change: 01:13:48 TE-metric: 19, Metric: 0
检查备份邻居
目的
在设备 R1 上,使用命令检查 show (ospf | ospf3) backup neighbor
备用路径的直接下一跃点可用的邻接方。
行动
user@R1> show ospf backup neighbor Topology default backup neighbors: Area 0.0.0.0 backup neighbors: 10.255.164.4 Neighbor to Self Metric: 10 Self to Neighbor Metric: 10 Direct next-hop: so-0/2/0.0 via 192.168.242.18 Direct next-hop: t1-0/1/0.0 via 192.168.241.18 10.255.164.2 Neighbor to Self Metric: 10 Self to Neighbor Metric: 10 Direct next-hop: so-0/2/2.0 via 192.168.242.2 Direct next-hop: t1-0/1/2.0 via 192.168.241.2 10.255.164.3 (LSP endpoint) Neighbor to Self Metric: 20 Self to Neighbor Metric: 20 Direct next-hop: path1 Direct next-hop: path2 Topology voice backup neighbors: Area 0.0.0.0 backup neighbors: 10.255.164.4 Neighbor to Self Metric: 10 Self to Neighbor Metric: 10 Direct next-hop: so-0/2/0.0 via 192.168.242.18 Direct next-hop: t1-0/1/0.0 via 192.168.241.18 10.255.164.2 Neighbor to Self Metric: 10 Self to Neighbor Metric: 10 Direct next-hop: so-0/2/2.0 via 192.168.242.2 Direct next-hop: t1-0/1/2.0 via 192.168.241.2 10.255.164.3 (LSP endpoint) Neighbor to Self Metric: 20 Self to Neighbor Metric: 20 Direct next-hop: path1 Direct next-hop: path2
检查 SPF 计算
目的
在设备 R1 上,使用 show (ospf | ospf3) backup spf detail
命令检查备份路径的 OSPF 最短路径优先 (SPF) 计算。为了限制输出,请在命令中指定语音拓扑。
行动
user@R1> show ospf backup spf detail topology voice Topology voice results: Area 0.0.0.0 results: 192.168.241.2 Self to Destination Metric: 10 Parent Node: 10.255.164.1 Primary next-hop: t1-0/1/2.0 Backup next-hop: path1 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 20, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Track Item: 10.255.164.2 Eligible, Reason: Contributes backup next-hop Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Interface is already covered Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Track Item: 10.255.164.1 Not evaluated, Reason: Interface is already covered 192.168.241.18 Self to Destination Metric: 10 Parent Node: 10.255.164.1 Primary next-hop: t1-0/1/0.0 Backup next-hop: so-0/2/0.0 via 192.168.242.18 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 30, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Track Item: 10.255.164.1 Track Item: 10.255.164.2 Track Item: 10.255.164.4 Not eligible, Reason: Path loops Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Eligible, Reason: Contributes backup next-hop Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Track Item: 10.255.164.1 Not evaluated, Reason: Interface is already covered 192.168.242.2 Self to Destination Metric: 10 Parent Node: 10.255.164.1 Primary next-hop: so-0/2/2.0 Backup next-hop: path2 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 20, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Track Item: 10.255.164.2 Eligible, Reason: Contributes backup next-hop Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Interface is already covered Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Track Item: 10.255.164.1 Not evaluated, Reason: Interface is already covered 192.168.242.18 Self to Destination Metric: 10 Parent Node: 10.255.164.1 Primary next-hop: so-0/2/0.0 Backup next-hop: t1-0/1/0.0 via 192.168.241.18 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 30, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Track Item: 10.255.164.1 Track Item: 10.255.164.2 Track Item: 10.255.164.4 Not eligible, Reason: Path loops Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Eligible, Reason: Contributes backup next-hop Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Track Item: 10.255.164.1 Not evaluated, Reason: Interface is already covered 10.255.164.2 Self to Destination Metric: 10 Parent Node: 192.168.241.2 Parent Node: 192.168.242.2 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 10, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Track Item: 10.255.164.2 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 0, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Track Item: 10.255.164.1 Track Item: 10.255.164.2 Not evaluated, Reason: Primary next-hop multipath 10.255.164.4 Self to Destination Metric: 10 Parent Node: 192.168.241.18 Parent Node: 192.168.242.18 Primary next-hop: so-0/2/0.0 via 192.168.242.18 Primary next-hop: t1-0/1/0.0 via 192.168.241.18 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 20, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Track Item: 10.255.164.4 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 0, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Track Item: 10.255.164.1 Track Item: 10.255.164.4 Not evaluated, Reason: Primary next-hop multipath 192.168.241.10 Self to Destination Metric: 20 Parent Node: 10.255.164.4 Primary next-hop: so-0/2/0.0 via 192.168.242.18 Primary next-hop: t1-0/1/0.0 via 192.168.241.18 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 20, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath 192.168.242.6 Self to Destination Metric: 20 Parent Node: 10.255.164.2 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 10, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 30, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Track Item: 10.255.164.1 Track Item: 10.255.164.2 Not evaluated, Reason: Primary next-hop multipath 192.168.242.10 Self to Destination Metric: 20 Parent Node: 10.255.164.4 Primary next-hop: so-0/2/0.0 via 192.168.242.18 Primary next-hop: t1-0/1/0.0 via 192.168.241.18 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 20, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath 192.168.242.22 Self to Destination Metric: 20 Parent Node: 10.255.164.2 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 20, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Track Item: 10.255.164.2 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath 10.255.164.3 Self to Destination Metric: 20 Parent Node: 192.168.242.6 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 0, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath 10.255.164.5 Self to Destination Metric: 20 Parent Node: 192.168.241.10 Parent Node: 192.168.242.10 Parent Node: 192.168.242.22 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Primary next-hop: so-0/2/0.0 via 192.168.242.18 Primary next-hop: t1-0/1/0.0 via 192.168.241.18 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 10, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 10, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath 192.168.242.14 Self to Destination Metric: 25 Parent Node: 10.255.164.5 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Primary next-hop: so-0/2/0.0 via 192.168.242.18 Primary next-hop: t1-0/1/0.0 via 192.168.241.18 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 10, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 15, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 15, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath 192.168.242.26 Self to Destination Metric: 25 Parent Node: 10.255.164.3 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 5, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 15, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath 10.255.164.6 Self to Destination Metric: 25 Parent Node: 192.168.242.14 Parent Node: 192.168.242.26 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Primary next-hop: so-0/2/0.0 via 192.168.242.18 Primary next-hop: t1-0/1/0.0 via 192.168.241.18 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 5, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 15, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 15, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath 192.168.241.14 Self to Destination Metric: 30 Parent Node: 10.255.164.5 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Primary next-hop: so-0/2/0.0 via 192.168.242.18 Primary next-hop: t1-0/1/0.0 via 192.168.241.18 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 15, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath 192.168.241.26 Self to Destination Metric: 30 Parent Node: 10.255.164.3 Primary next-hop: so-0/2/2.0 via 192.168.242.2 Primary next-hop: t1-0/1/2.0 via 192.168.241.2 Backup Neighbor: 10.255.164.3 (LSP endpoint) Neighbor to Destination Metric: 10, Neighbor to Self Metric: 20 Self to Neighbor Metric: 20, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.2 Neighbor to Destination Metric: 20, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath Backup Neighbor: 10.255.164.4 Neighbor to Destination Metric: 25, Neighbor to Self Metric: 10 Self to Neighbor Metric: 10, Backup preference: 0x0 Not evaluated, Reason: Primary next-hop multipath
为 OSPF 配置链路保护
您可以为启用了 OSPF 的任何接口配置链路保护。启用链路保护后,Junos OS 会为遍历受保护接口的所有目标路由创建通往下一主跃点的备用路径。当您假设只有一个链路可能不可用,但相邻节点仍可通过另一个接口使用时,请使用链路保护。
以下项目支持链路保护:
OSPFv2 和 OSPFv3 接口
OSPFv3 单播领域
OSPFv2 单播拓扑,组播拓扑除外
OSPFv2 和 OSPFv3 支持的所有路由实例
逻辑系统
要为 OSPF 接口配置链路保护,请执行以下操作:
link-protection
在层次结构级别包含语句[edit protocols (ospf | ospf3) area area-id interface interface-name]
。
为 OSPF 配置链路保护时,还必须配置按数据包负载均衡路由策略,以确保路由协议进程为路由表中的给定路由安装所有下一跃点。
在以下示例中,区域 0.0.0.0 中的 OSPF 接口 so-0/0/0.0 配置为链路保护。如果通过此接口的目标路由的链路不可用,Junos OS 将通过相邻节点上的另一个接口创建无环路备份路径,从而避免不再可用的链路。
[edit] protocols { ospf { area 0.0.0.0 { interface so-0/0/0.0 { link-protection; } } } }
参见
为 OSPF 配置节点链路保护
您可以在启用了 OSPF 的任何接口上配置节点链路保护。节点链路保护为遍历受保护接口的所有目标路由建立一条通过不同路由设备的备用路径。节点链路保护假定整个路由设备或节点出现故障。因此,Junos OS 会计算一个避免主下一跃点路由设备的备份路径。
以下项目支持节点链路保护:
OSPFv2 和 OSPFv3 接口
OSPFv3 单播领域
OSPFv2 单播拓扑
OSPFv2 和 OSPFv3 支持的所有路由实例
逻辑系统
要为 OSPF 接口配置节点链路保护,请执行以下操作:
node-link-protection
在层次结构级别包含语句[edit protocols (ospf | ospf3) area area-id interface interface-name]
。
您还必须配置按数据包负载均衡路由策略,以确保路由协议进程为路由表中的给定路由安装所有下一跃点。
在以下示例中,区域 0.0.0.0 中的 OSPF 接口 so-0/0/0.0 配置为节点链路保护。如果通过此接口的目标路由的链路不可用,Junos OS 将通过其他路由设备创建无环路备份路径,从而避开主下一跃点路由设备。
[edit] protocols { ospf { area 0.0.0.0 { interface so-0/0/0.0 { node-link-protection; } } } }
为 OSPF 配置节点到链路保护回退
您可以为启用了 OSPF 的任何接口配置链路保护。启用链路保护后,Junos OS 会为遍历受保护接口的所有目标路由创建通往下一主跃点的备用路径。当您假设只有一个链路可能不可用,但相邻节点仍可通过另一个接口使用时,请使用链路保护。
您可以在启用了 OSPF 的任何接口上配置节点链路保护。节点链路保护为遍历受保护接口的所有目标路由建立一条通过不同路由设备的备用路径。节点链路保护假定整个路由设备或节点出现故障。因此,Junos OS 会计算一个避免主下一跃点路由设备的备份路径。
在某些拓扑中,可能需要对下一主跃点中的节点故障进行本地修复保护,这可能不可用。在这种情况下,为了确保存在某种级别的本地修复功能,需要回退机制。由于链路保护不如节点保护严格,因此可能存在链路保护并为这些目标提供相同的链路保护(因此由它产生前缀)。
要为 OSPF 接口配置节点到链路保护回退:
node-link-degradation
在层次结构级别包含语句[edit protocols (ospf | ospf3) backup-spf-options]
。
排除 OSPF 接口作为受保护接口的备份
默认情况下,属于默认实例或特定路由实例的所有 OSPF 接口都有资格作为配置了链路保护或节点链路保护的接口的备份接口。您可以指定将任何 OSPF 接口排除在用作受保护接口的备份接口之外。
要将 OSPF 接口排除为受保护接口的备份接口,请执行以下操作:
no-eligible-backup
在层次结构级别包含语句[edit protocols (ospf | ospf3) area area-id interface interface-name]
。
在以下示例中,接口 so-0/0/0.0 已配置为禁止发往受保护接口的流量的备份流量。这意味着,如果受保护接口的相邻下一跃点路径或节点发生故障,则无法使用接口 so-0/0/0.0 将流量传输到备份路径。
[edit] protocols { ospf { area 0.0.0.0 { interface so-0/0/0.0 { no-eligible-backup; } } } }
为受保护的 OSPF 接口配置备份 SPF 选项
默认情况下,如果至少为链路保护或节点链路保护配置了一个 OSPF 接口,Junos OS 将为 OSPF 实例中的所有拓扑计算备份下一跃点。您可以配置以下备份最短路径优先 (SPF) 选项来覆盖默认行为:
禁用计算 OSPF 实例或实例中特定拓扑的备份下一跃点。
防止在路由表或 OSPF 实例的转发表中安装备份下一跃点,或实例中的特定拓扑。
将备份下一跃点的计算限制为 RFC 5286《 IP 快速重新路由的基本规范:无环路备用》中定义的路径子集。
您可以禁用 OSPF 实例的备份 SPF 算法或实例中的特定拓扑。这样做会阻止计算该 OSPF 实例或拓扑的备份下一跃点。
要禁用 OSPF 实例或拓扑的备份下一跃点计算:
disable
在或[edit protocols ospf backup-spf-options topology topology-name]
层次结构级别包含[edit protocols (ospf | ospf3) backup-spf-options]
语句。
在以下示例中,已禁用 OSPF 拓扑 语音的备份下一跃点计算:
[edit] protocols { ospf { topology voice { backup-spf-options { disable; } } } }
您可以配置路由设备,以防止在路由表或 OSPF 实例的转发表或 OSPF 实例中的特定拓扑中安装备份下一跃点。SPF 算法将继续计算备份下一跃点,但未安装它们。
要防止路由设备在路由表或转发表中安装备份下一跃点,请执行以下操作:
no-install
在 或[edit protocols ospf topology topology-name]
层次结构级别包含[edit protocols (ospf | ospf3) backup-spf-options]
语句。
在以下示例中,路由表或转发表中未安装 OSPF 拓扑 语音 的备份下一跃点。将继续安装其他 OSPF 实例或拓扑的任何计算出的备份下一跃点。
[edit] protocols { ospf { topology voice { backup-spf-options { no-install; } } } }
可以将备份下一跃点的计算限制为 下游路径,如 RFC 5286 中所定义。您可以指定 Junos OS 仅将下游路径用作 OSPF 实例或 OSPF 实例中特定拓扑的受保护接口的备份下一跃点。在下游路径中,从备份邻接方到目标的距离必须小于从计算路由设备到目标的距离。仅使用下游路径作为受保护接口的无环路备用路径可确保这些路径不会导致微环路。但是,您的网络备份覆盖范围可能不太理想。
要将备份下一跃点的计算限制为下游路径,请执行以下操作:
downstream-paths-only
在或[edit protocols ospf backup-spf-options topology topology-name]
层次结构级别包含[edit protocols (ospf | ospf3) backup-spf-options]
语句。
在以下示例中,仅将下游路径计算为拓扑 语音的备份下一跃点:
[edit] protocols { ospf { topology voice { backup-spf-options { downstream-paths-only; } } } }
参见
将 RSVP 标签交换路径配置为 OSPF 的备份路径
将 OSPF 接口配置为链路保护或节点链路保护时,依赖于单跃点邻居备份路径的最短路径优先 (SPF) 计算,可能会导致特定网络拓扑的备份覆盖率低于 100%。通过将 RSVP LSP 配置为备用路径,可以增强 OSPF 和 LDP 标签交换路径 (LSP) 的覆盖范围。
配置 LSP 时,必须指定出口路由器的 IP 地址。
RSVP LSP 只能用作 OSPFv2 的默认拓扑的备份路径,而不能用作已配置拓扑的备份路径。此外,RSVP LSP 不能用作 OSPFv2 或 OSPFv3 的非默认实例的备份路径。
要将特定 RSVP LSP 配置为备份路径,请执行以下操作:
backup
在层次结构级别包含语句[edit protocols mpls labeled-switched-path lsp-name]
。- 通过在层次结构级别包含
to ip-address
[edit protocols mpls label-switched-path]
语句来指定出口路由器的地址。
在以下示例中,RSVP LSP f 到g 配置为受保护 OSPF 接口的备份 LSP。出口路由器配置了 IP 地址 192.168.1.4。
[edit] protocols { mpls { label-switched-path f-to-g { to 192.168.1.4; backup; } } }
OSPF 网络中基于 LDP 隧道的远程 LFA 概述
在 OSPF 网络中,无环路备用 (LFA) 是直接连接的邻接方,它通过本地修复点 (PLR) 上的受保护链路为可到达的目标提供预先计算的备份路径。远程 LFA 不直接连接到 PLR,而是使用动态创建的 LDP 隧道提供到远程 LFA 节点的预先计算的备份路径。当主链路发生故障时,PLR 使用此远程 LFA 备份路径。远程 LFA 的主要目标是扩大 OSPF 网络的备份覆盖范围,并为第 1 层城域网环网提供保护。
LFA 不能为 OSPF 网络提供完整的备份覆盖范围。对于通常采用环形拓扑结构的城域以太网网络来说,这是一个重大挫折。为了克服这一挫折,通常使用资源预留协议 - 流量工程 (RSVP-TE) 备份隧道来扩展备份覆盖范围。但是,大多数网络提供商已经将 LDP 作为 MPLS 隧道设置协议实施,并且不希望仅仅为了备份覆盖而实施 RSVP-TE 协议。LDP 会自动为 OSPF 网络中的所有潜在目标建立传输隧道,因此是首选协议。为 MPLS 隧道设置实施的现有 LDP 可以重复使用来保护 OSPF 网络和后续 LDP 目标,从而消除了对备份覆盖范围的 RSVP-TE 备份隧道的需求。
要计算远程 LFA 备份路径,OSPF 协议按以下方式确定远程 LFA 节点:
首先计算从相邻路由器穿过 PLR 受保护链路的反向最短路径。反向最短路径首先使用传入链路指标而不是传出链路指标到达相邻节点。
结果是一组链接和节点,这是从每个叶节点到根节点的最短路径。
计算其余相邻路由器上的最短路径优先 (SPF),以查找无需遍历受保护链路即可到达的节点列表。
结果是从根节点到所有叶节点的最短路径上的另一组链路和节点。
根据上述结果确定公共节点。这些节点是远程 LFA。
OSPF 侦听 LDP 路由的通告标签。对于每个播发的 LDP 路由,OSPF 会检查它是否包含提供的下一跃点 LDP。如果相应的 OSPF 路由确实有备份下一跃点,则 OSPF 将运行备份策略并添加附加跟踪路由,并将相应的 LDP 标签交换路径下一跃点作为备份下一跃点。如果没有备份下一跃点,LDP 将构建到远程 LFA 的动态 LDP 隧道,LDP 在远程 LFA 节点和 PLR 节点之间建立目标邻接关系。此备份路由具有两个 LDP 标签。顶部标签是 OSPF 路由,表示从 PLR 到远程 LFA 路由的备份路径。底部标签是 LDP MPLS 标签交换路径,表示从远程 LFA 到达最终目标的路由。当 LDP 会话中断且远程隧道不再可用时,OSPF 会更改一直使用此备份 LDP 隧道的所有路由。
目前,Junos OS 仅支持 IPv4 传输 LSP。如果需要为 IPv6 IGP 网络重复使用 IPv4 传输 LSP,请将 IPv6 显式 NULL 标签添加到跟踪路由的标签堆栈中。系统会自动将 IPv4 LSP 转换为 IPv6 LSP。
LDP 可能容易受到自动定向邻接的攻击,可以使用以下全部或部分机制缓解这些威胁:
距离多个跃点的远程 LFA 使用扩展你好消息来指示愿意建立目标 LDP 会话。远程 LFA 可以通过过滤这些消息并仅接受源自访问或过滤器列表允许的来源的消息来减少欺骗性扩展你好消息的威胁。
需要使用应用组或 LDP 全局级别身份验证,通过 TCP-MD5 对给定 IGP/LDP 域中的所有自动定位 LDP 会话进行身份验证。
作为一项额外的安全措施,修复或远程隧道端点路由器应从一组无法从路由域外部访问的地址进行分配。
参见
在 OSPF 网络中通过 LDP 隧道配置远程 LFA 备份
远程无环路备用 (LFA) 的主要目标是增加 OSPF 路由的备份覆盖范围,并提供保护,特别是对于第 1 层城域网环网。为 MPLS 隧道设置实施的现有 LDP 可以重用于保护 OSPF 网络和后续 LDP 目标。OSPF 协议可创建动态 LDP 隧道,以便从本地修复点 (PLR) 到达远程 LFA 节点。当主链路发生故障时,PLR 使用此远程 LFA 备份路径。
在 OSPF 网络中通过 LDP 隧道配置远程 LFA 之前,必须执行以下操作:
在环路接口上启用 LDP。
配置环路接口,因为如果没有环路接口,就无法形成 LDP 目标邻接关系。LDP 目标邻接对于确定远程 LFA 备份路径至关重要。
确保远程 LFA 允许非对称远程邻接方发现,也就是说,它必须定期向启动远程邻接方以实现 LDP 自动定向邻接的路由器发送有针对性的 你好 消息。
在 PLR 上配置链路保护或节点链路保护。
要在 OSPF 网络中通过 LDP 隧道配置远程 LFA 备份,请执行以下操作:
参见
示例:在 OSPF 网络中通过 LDP 隧道配置远程 LFA
在 OSPF 网络中,无环路备用 (LFA) 是直接连接的邻接方,它通过本地修复点 (PLR) 上的受保护链路提供到可到达目标的预先计算的备份路径。远程 LFA 不直接连接到 PLR,而是使用动态创建的 LDP 隧道提供到远程 LFA 节点的预先计算的备份路径。当主链路发生故障时,PLR 使用此远程 LFA 备份路径。远程 LFA 的主要目标是扩大 OSPF 网络的备份覆盖范围,并为第 1 层城域网环网提供保护。此示例说明如何为 OSPF 网络中的 LDP 隧道配置远程 LFA,以扩展备份保护。
要求
此示例使用以下硬件和软件组件:
-
九个 MX 系列路由器,连接的接口上启用了 OSPF 协议和 LDP。
-
在所有设备上运行的 Junos OS 15.1 或更高版本。
在 OSPF 网络中通过 LDP 隧道配置远程 LFA 之前,请确保以下事项:
-
环路接口上启用了 LDP。如果没有环路接口,则无法形成 LDP 目标邻接关系。如果没有 LDP 目标邻接,则无法配置远程 LFA。
-
远程 LFA 必须允许非对称远程邻居发现,也就是说,它必须定期向启动远程邻居以进行 LDP 自动目标邻接的路由器发送有针对性的 hellos。
-
必须在本地修复点 (PLR) 上配置链路保护或节点链路保护。
概述
该示例在一个环形拓扑中包含九个路由器。在直连接口上配置 OSPF 协议。设备 R6 是公共出借权。此示例验证 Junos OS 是否使用 LDP 下一跃点路由作为备份路由更新设备 R6 的路由表。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改与您的网络配置匹配所需的任何详细信息,将命令复制并粘贴到层次结构级别的 CLI [edit] 中,然后从配置模式进入 commit
。
R0
set interfaces ge-0/0/0 unit 0 family inet address 10.1.1.1/24 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 10.90.1.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 10.110.1.1/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.1/32 set interfaces lo0 unit 0 family mpls set routing-options router-id 10.1.1.1 set routing-options forwarding-table export per-packet set protocols mpls interface ge-0/0/0.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface ge-0/0/2.0 set protocols mpls interface lo0.0 set protocols ospf backup-spf-options remote-backup-calculation set protocols ospf export static set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ldp auto-targeted-session teardown-delay 20 set protocols ldp auto-targeted-session maximum-sessions 60 set protocols ldp egress-policy static set protocols ldp interface ge-0/0/0.0 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface ge-0/0/2.0 set protocols ldp interface lo0.0 set policy-options policy-statement per-packet then load-balance per-packet set policy-options policy-statement per-packet then accept set policy-options policy-statement static from protocol static set policy-options policy-statement static then accept
R1
set interfaces ge-0/0/0 unit 0 family inet address 10.1.1.2/24 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 10.20.1.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 10.80.1.1/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/0/3 unit 0 family inet address 10.100.1.1/24 set interfaces ge-0/0/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.2.2.2/32 set interfaces lo0 unit 0 family mpls set routing-options router-id 10.2.2.2 set routing-options forwarding-table export per-packet set protocols ospf backup-spf-options remote-backup-calculation set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 link-protection set protocols ospf area 0.0.0.0 interface ge-0/0/3.0 set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ldp auto-targeted-session teardown-delay 20 set protocols ldp auto-targeted-session maximum-sessions 60 set protocols ldp interface ge-0/0/0.0 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface ge-0/0/2.0 set protocols ldp interface ge-0/0/3.0 set protocols ldp interface lo0.0 set policy-options policy-statement per-packet then load-balance per-packet set policy-options policy-statement per-packet then accept
R2
set interfaces ge-0/0/0 unit 0 family inet address 10.20.1.2/24 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 10.30.1.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 10.110.1.1/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.3.3.3/32 set interfaces lo0 unit 0 family mpls set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface fxp0.0 disable set policy-options policy-statement per-packet then load-balance per-packet set policy-options policy-statement per-packet then accept
R3
set interfaces ge-0/0/0 unit 0 family inet address 10.30.1.2/24 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 10.40.1.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.4.4.4/32 set interfaces lo0 unit 0 family mpls set routing-options router-id 10.4.4.4 set routing-options forwarding-table export per-packet set protocols ospf backup-spf-options remote-backup-calculation set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ldp auto-targeted-session teardown-delay 20 set protocols ldp auto-targeted-session maximum-sessions 60 set protocols ldp interface ge-0/0/0.0 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface lo0.0 set policy-options policy-statement per-packet then load-balance per-packet set policy-options policy-statement per-packet then accept
R4
set interfaces ge-0/0/0 unit 0 family inet address 10.40.1.2/24 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 10.50.1.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.5.5.5/32 set interfaces lo0 unit 0 family mpls set routing-options router-id 10.5.5.5 set routing-options forwarding-table export per-packet set protocols ospf backup-spf-options remote-backup-calculation set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ldp auto-targeted-session teardown-delay 60 set protocols ldp auto-targeted-session maximum-sessions 20 set protocols ldp interface ge-0/0/0.0 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface lo0.0 set policy-options policy-statement per-packet then load-balance per-packet set policy-options policy-statement per-packet then accept
R5
set interfaces ge-0/0/0 unit 0 family inet address 10.50.1.2/24 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 10.60.1.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.6.6.6/32 set interfaces lo0 unit 0 family mpls set routing-options router-id 10.6.6.6 set routing-options forwarding-table export per-packet set protocols ospf backup-spf-options remote-backup-calculation set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ldp auto-targeted-session teardown-delay 20 set protocols ldp auto-targeted-session maximum-sessions 60 set protocols ldp interface ge-0/0/0.0 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface lo0.0 set policy-options policy-statement per-packet then load-balance per-packet set policy-options policy-statement per-packet then accept
R6
set interfaces ge-0/0/0 unit 0 family inet address 10.60.1.2/24 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 10.70.1.1/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/2 unit 0 family inet address 10.80.1.2/24 set interfaces ge-0/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.7.7.7/32 set interfaces lo0 unit 0 family mpls set routing-options router-id 10.7.7.7 set routing-options forwarding-table export per-packet set protocols ospf topology default backup-spf-options remote-backup-calculation set protocols ospf backup-spf-options remote-backup-calculation set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 link-protection set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 link-protection set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 link-protection set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ldp auto-targeted-session teardown-delay 20 set protocols ldp auto-targeted-session maximum-sessions 60 set protocols ldp interface ge-0/0/0.0 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface ge-0/0/2.0 set protocols ldp interface lo0.0 set policy-options policy-statement per-packet then load-balance per-packet set policy-options policy-statement per-packet then accept
R7
set interfaces ge-0/0/0 unit 0 family inet address 10.70.1.2/24 set interfaces ge-0/0/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.8.8.8/32 set interfaces lo0 unit 0 family mpls set routing-options router-id 10.8.8.8 set routing-options forwarding-table export per-packet set protocols mpls interface ge-0/0/0.0 set protocols mpls interface lo0.0 set protocols ospf backup-spf-options remote-backup-calculation set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ldp auto-targeted-session teardown-delay 20 set protocols ldp auto-targeted-session maximum-sessions 60 set protocols ldp interface ge-0/0/0.0 set protocols ldp interface lo0.0 set policy-options policy-statement per-packet then load-balance per-packet set policy-options policy-statement per-packet then accept
R8
set interfaces ge-0/0/0 unit 0 family inet address 10.90.1.2/24 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family inet address 10.100.1.2/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.9.9.9/32 set interfaces lo0 unit 0 family mpls set routing-options router-id 10.9.9.9 set routing-options forwarding-table export per-packet set protocols mpls interface ge-0/0/0.0 set protocols mpls interface ge-0/0/1.0 set protocols mpls interface lo0.0 set protocols ospf backup-spf-options remote-backup-calculation set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ldp auto-targeted-session teardown-delay 20 set protocols ldp auto-targeted-session maximum-sessions 60 set protocols ldp interface ge-0/0/0.0 set protocols ldp interface ge-0/0/1.0 set protocols ldp interface lo0.0 set policy-options policy-statement per-packet then load-balance per-packet set policy-options policy-statement per-packet then accept
配置设备 R6
分步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 R6:
-
配置接口。
[edit interfaces] user@R6# set ge-0/0/0 unit 0 family inet address 10.60.1.2/24 user@R6# set ge-0/0/0 unit 0 family mpls user@R6# set ge-0/0/1 unit 0 family inet address 10.70.1.1/24 user@R6# set ge-0/0/1 unit 0 family mpls user@R6# set ge-0/0/2 unit 0 family inet address 10.80.1.2/24 user@R6# set ge-0/0/2 unit 0 family mpls
-
将环路地址分配给设备。
[edit lo0 unit 0 family] user@R6# set address 10.7.7.7/32 user@R6# set mpls
-
配置路由器 ID。使用导出语句将策略应用于本地路由器的转发表。
[edit routing-options] user@R6# set router-id 10.7.7.7 user@R6# set forwarding-table export per-packet
-
启用远程 LFA 备份,该备份使用动态 LDP 标签交换路径计算备份下一跃点。
[edit protocols ospf] user@R6# set topology default backup-spf-options remote-backup-calculation user@R6# set backup-spf-options remote-backup-calculation
-
为 OSPF 区域中的接口配置流量工程和链路保护。
[edit protocols ospf] user@R6# set traffic-engineering user@R6# set area 0.0.0.0 interface ge-0/0/0.0 link-protection user@R6# set area 0.0.0.0 interface ge-0/0/1.0 link-protection user@R6# set area 0.0.0.0 interface ge-0/0/2.0 link-protection user@R6# set area 0.0.0.0 interface lo0.0
-
指定远程 LFA 关闭时保持目标 LDP 会话的时间间隔,并指定自动定向 LDP 会话的最大数量以优化内存的使用。
[edit protocols ldp] user@R6# set auto-targeted-session teardown-delay 20 user@R6# set auto-targeted-session maximum-sessions 60
-
在接口上配置 LDP 协议。
[edit protocols ldp] user@R6# set interface ge-0/0/0.0 user@R6# set interface ge-0/0/1.0 user@R6# set interface ge-0/0/2.0 user@R6# set interface lo0.0
-
配置策略选项以对策略语句路由策略的每个数据包进行负载平衡。
[edit policy-options policy-statement] user@R6# set per-packet then load-balance per-packet user@R6# set per-packet then accept
结果
在配置模式下,输入 show interfaces、 show protocols、 show policy-options和 show routing-options 命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R6# show interfaces ge-0/0/0 { unit 0 { family inet { address 10.60.1.2/24; } family mpls; } } ge-0/0/1 { unit 0 { family inet { address 10.70.1.1/24; } family mpls; } } ge-0/0/2 { unit 0 { family inet { address 10.80.1.2/24; } family mpls; } } lo0 { unit 0 { family inet { address 10.7.7.7/32; } family mpls; } }
user@R6# show protocols ospf { topology default { backup-spf-options { remote-backup-calculation; } } backup-spf-options { remote-backup-calculation; inactive: per-prefix-calculation all; } traffic-engineering; area 0.0.0.0 { interface ge-0/0/0.0 { link-protection; } interface ge-0/0/1.0 { link-protection; } interface ge-0/0/2.0 { link-protection; } interface lo0.0; } } ldp { auto-targeted-session { teardown-delay 20; maximum-sessions 60; } interface ge-0/0/0.0; interface ge-0/0/1.0; interface ge-0/0/2.0; interface lo0.0; }
user@R6# show policy-options policy-statement per-packet { then { load-balance per-packet; accept; } }
user@R6# show routing-options router-id 10.7.7.7; forwarding-table { export per-packet; }
如果完成设备配置,请从配置模式输入 commit
。
验证
确认配置工作正常。
验证路由
目的
验证是否学习了预期的路由。
行动
在设备 R6 上,在操作模式下,运行 show route 10.6.6.6/24
命令以在路由表中显示路由。
user@R6> show route 10.6.6.6/24
inet.0: 75 destinations, 75 routes (75 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.6.6.6/32 *[OSPF/10] 02:21:07, metric 1
> to 10.60.1.1 via ge-0/0/0.0
to 10.80.1.1 via ge-0/0/2.0, Push 299872
inet.3: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.6.6.6/32 *[LDP/9] 02:21:07, metric 1
> to 10.60.1.1 via ge-0/0/0.0
to 10.80.1.1 via ge-0/0/2.0, Push 299792, Push 299872(top)
inet.0: 75 destinations, 75 routes (75 active, 0 holddown, 0 hidden) 10.6.6.6/32 (1 entry, 1 announced) State: <FlashAll> *OSPF Preference: 10 Next hop type: Router, Next hop index: 1048585 Address: 0x9df2690 Next-hop reference count: 10 Next hop: 10.60.1.1 via ge-0/0/0.0 weight 0x1, selected Session Id: 0x141 Next hop: 10.80.1.1 via ge-0/0/2.0 weight 0x101 uflags Remote neighbor path Label operation: Push 299872 Label TTL action: prop-ttl Load balance label: Label 299872: None; Label element ptr: 0x9dc27a0 Label parent element ptr: 0x0 Label element references: 6 Label element child references: 4 Label element lsp id: 0 Session Id: 0x142 State: <Active Int> Age: 2:22:40 Metric: 1 Validation State: unverified Area: 0.0.0.0 Task: OSPF Announcement bits (2): 0-KRT 4-LDP AS path: I inet.3: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) 10.6.6.6/32 (1 entry, 1 announced) State: <FlashAll> *LDP Preference: 9 Next hop type: Router, Next hop index: 0 Address: 0x9df2a90 Next-hop reference count: 1 Next hop: 10.60.1.1 via ge-0/0/0.0 weight 0x1, selected Label element ptr: 0x9dc0dc0 Label parent element ptr: 0x0 Label element references: 1 Label element child references: 0 Label element lsp id: 0 Session Id: 0x0 Next hop: 10.80.1.1 via ge-0/0/2.0 weight 0x101 uflags Remote neighbor path Label operation: Push 299792, Push 299872(top) Label TTL action: prop-ttl, prop-ttl(top) Load balance label: Label 299792: None; Label 299872: None; Label element ptr: 0x9dc1ba0 Label parent element ptr: 0x9dc27a0 Label element references: 1 Label element child references: 0 Label element lsp id: 0 Session Id: 0x0 State: <Active Int> Age: 2:22:40 Metric: 1 Validation State: unverified Task: LDP Announcement bits (1): 0-Resolve tree 1 AS path: I
意义
输出显示设备 R6 路由表中的所有路由。
验证 LDP 路由
目的
验证自动定位的 LDP 路由。
行动
在操作模式下,输入 show ldp session auto-targeted detail
命令。
user@R6>show ldp session auto-targeted detail
Address: 10.4.4.4, State: Operational, Connection: Open, Hold time: 28
Session ID: 10.7.7.7:0--10.4.4.4:0
Next keepalive in 8 seconds
Active, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1
Neighbor types: auto-targeted
Keepalive interval: 10, Connect retry interval: 1
Local address: 10.7.7.7, Remote address: 10.4.4.4
Up for 02:28:28
Capabilities advertised: none
Capabilities received: none
Protection: disabled
Session flags: none
Local - Restart: disabled, Helper mode: enabled
Remote - Restart: disabled, Helper mode: enabled
Local maximum neighbor reconnect time: 120000 msec
Local maximum neighbor recovery time: 240000 msec
Local Label Advertisement mode: Downstream unsolicited
Remote Label Advertisement mode: Downstream unsolicited
Negotiated Label Advertisement mode: Downstream unsolicited
MTU discovery: disabled
Nonstop routing state: Not in sync
Next-hop addresses received:
10.4.4.4
10.30.1.2
10.40.1.1
验证 OSPF 路由
目的
显示设备 R6 的 OSPF 路由表中的所有 LDP 备份路由。
行动
在设备 R6 上,在操作模式下,运行 show ospf route
命令以显示 OSPF 路由表中的路由。
user@R6> show ospf route
Topology default Route Table:
Prefix Path Route NH Metric NextHop Nexthop
Type Type Type Interface Address/LSP
10.1.1.1 Intra AS BR IP 2 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.2.2.2 Intra Router IP 1 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.4.4.4 Intra Router IP 3 ge-0/0/0.0 10.60.1.1
ge-0/0/2.0 10.80.1.1
10.5.5.5 Intra Router IP 2 ge-0/0/0.0 10.60.1.1
Bkup LSP LDP->10.4.4.4
10.6.6.6 Intra Router IP 1 ge-0/0/0.0 10.60.1.1
Bkup LSP LDP->10.4.4.4
10.8.8.8 Intra Router IP 1 ge-0/0/1.0 10.70.1.2
10.9.9.9 Intra Router IP 2 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.1.1.1/32 Intra Network IP 2 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.2.2.2/32 Intra Network IP 1 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.3.3.3/32 Intra Network IP 2 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.4.4.4/32 Intra Network IP 3 ge-0/0/0.0 10.60.1.1
ge-0/0/2.0 10.80.1.1
10.5.5.5/32 Intra Network IP 2 ge-0/0/0.0 10.60.1.1
Bkup LSP LDP->10.4.4.4
10.6.6.6/32 Intra Network IP 1 ge-0/0/0.0 10.60.1.1
Bkup LSP LDP->10.4.4.4
10.7.7.7/32 Intra Network IP 0 lo0.0
10.8.8.8/32 Intra Network IP 1 ge-0/0/1.0 10.70.1.2
10.9.9.9/32 Intra Network IP 2 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.1.1.0/24 Intra Network IP 2 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.20.1.0/24 Intra Network IP 2 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.30.1.0/24 Intra Network IP 3 ge-0/0/2.0 10.80.1.1
Bkup IP ge-0/0/0.0 10.60.1.1
10.40.1.0/24 Intra Network IP 3 ge-0/0/0.0 10.60.1.1
Bkup IP ge-0/0/2.0 10.80.1.1
10.50.1.0/24 Intra Network IP 2 ge-0/0/0.0 10.60.1.1
Bkup LSP LDP->10.4.4.4
10.60.1.0/24 Intra Network IP 1 ge-0/0/0.0
10.70.1.0/24 Intra Network IP 1 ge-0/0/1.0
10.80.1.0/24 Intra Network IP 1 ge-0/0/2.0
90.1.1.0/24 Intra Network IP 3 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.100.1.0/24 Intra Network IP 2 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
10.110.1.0/24 Intra Network IP 3 ge-0/0/2.0 10.80.1.1
Bkup LSP LDP->10.4.4.4
意义
输出显示设备 R6 的 OSPF 路由表中的所有 LDP 备份路由。
验证指定的备份路径节点
目的
显示为给定目标确定的远程 LFA 下一跃点。
行动
在操作模式下,输入 show ospf backup spf results
命令。
user@R6> show ospf backup spf results
Topology default results:
Area 0.0.0.0 results:
10.6.6.6
Self to Destination Metric: 1
Parent Node: 10.60.1.2
Primary next-hop: ge-0/0/0.0 via 60.1.1.1
Backup next-hop: LDP->10.4.4.4 via ge-0/0/2.0
Backup Neighbor: 10.6.6.6 via: Direct
Neighbor to Destination Metric: 0, Neighbor to Self Metric: 1
Self to Neighbor Metric: 1, Backup preference: 0x0
Not eligible, Reason: Primary next-hop link fate sharing
Backup Neighbor: 10.2.2.2 via: Direct
Neighbor to Destination Metric: 2, Neighbor to Self Metric: 1
Self to Neighbor Metric: 1, Backup preference: 0x0
Not eligible, Reason: Path loops
Backup Neighbor: 10.8.8.8 via: Direct
Neighbor to Destination Metric: 2, Neighbor to Self Metric: 1
Self to Neighbor Metric: 1, Backup preference: 0x0
Not eligible, Reason: Path loops
Backup Neighbor: 10.4.4.4 via: LDP (LSP endpoint)
Neighbor to Destination Metric: 2, Neighbor to Self Metric: 3
Self to Neighbor Metric: 3, Backup preference: 0x0
Eligible, Reason: Contributes backup next-hop
意义
输出指示是否已将特定接口或节点指定为远程备份路径及其原因。
验证备份邻居
目的
显示设备 R6 的备份邻居
行动
在操作模式下,输入 show ospf backup neighbor
命令。
user@R6>show ospf backup neighbor
Topology default backup neighbors:
Area 0.0.0.0 backup neighbors:
10.6.6.6 via: Direct
Neighbor to Self Metric: 1
Self to Neighbor Metric: 1
Direct next-hop: ge-0/0/0.0 via 10.60.1.1
10.8.8.8 via: Direct
Neighbor to Self Metric: 1
Self to Neighbor Metric: 1
Direct next-hop: ge-0/0/1.0 via 10.70.1.2
10.2.2.2 via: Direct
Neighbor to Self Metric: 1
Self to Neighbor Metric: 1
Direct next-hop: ge-0/0/2.0 via 10.80.1.1
10.4.4.4 via: LDP (LSP endpoint)
Neighbor to Self Metric: 3
Self to Neighbor Metric: 3
Direct next-hop: LDP->10.4.4.4 via ge-0/0/2.0
Direct next-hop: LDP->10.4.4.4 via ge-0/0/0.0
Neighbors Protected: 2
意义
输出显示可用于区域 0.0.0.0 的备份邻居。