为 OSPF 配置无环路替代路由
OSPF 的每个前缀无环路备选选项
在某些拓扑和使用场景中,当多个目标发起相同的前缀时,对于最佳前缀发起方没有可行的 LFA,而非最佳前缀发起方则有一个。 每前缀 LFA 是一种技术,通过该技术,可以将 LFA 到非最佳前缀发起方的 LFA 用于将 LFA 代替至最佳前缀发起方以提供本地维修。这还可用于增加 OSPF 协议的本地维修覆盖范围。
每前缀无环路备选 (LFA)—无环路备选 (LFA) 是一种技术,通过该技术,邻接方可用作下一跳跃的备份,为流量在主下一跳跃(节点或链路)出现故障时临时流动提供本地维修路径。为此,基本要求是选定的备份邻接方提供与向目标的主下一跳跃有关的无环路路径,从而发起一组内部网关协议 (IGP) 前缀。
以下拓扑解释了每个前缀 LFA 功能适用的部署案例。

ABR1 和 ABR2 是区域边界路由器 (ABR),双宿主于 IPv6 核心网络,通告前缀 10.0.1.0/24 的前缀 10.0.1.0/24 的汇总 LSA。此外,从 PE 路由器的角度来看,ABR1 是 10.0.1.0/24 的最佳前缀发起器。在这种情况下,P2 对 ABR1 无效,因为成本相等的多路径 (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,以提供本地修复。在这种情况下,每前缀 LFA 可用于增加 OSPF 协议的本地维修覆盖范围。
环路自由备选 (LFA) 是一种机制,通过该机制,邻接方可用作下一跳跃的备份跃点,以便在主下一跳跃(节点或链路)出现故障时为流量提供临时流动的本地维修路径。为此,基本要求是选定的备份邻接方提供一个与原始下一跳跃有关、朝着发起一组 IGP 前缀的目标的无环路路径。在某些拓扑和使用场景中,多个目标可能源自相同的前缀,而最佳前缀发起方没有可行的 LFA,而非最佳前缀发起方则有一个。每前缀 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 计算可避免主下一跳跃路由设备的备份路径。
每前缀无环路备选 (FLA)—此技术可将邻接方用作下一跳跃备份,为在主下一跳跃(节点或链路)出现故障时临时流动的信息流提供本地维修路径。为此,基本要求是选定的备份邻接方提供一个与向目标的主下一跳跃有关且发起一组内部网关协议 (IGP) 前缀的无环路路径。
在某些拓扑和使用情景中,多个目标可能源自相同的前缀,而最佳前缀发起方没有可行的 LFA,而非最佳前缀发起方具有可行的 LFA。 每前缀 LFA 是一种机制,通过该机制,可以将 LFA 到非最佳前缀发起方的 LFA 用于将 LFA 代替至最佳前缀发起方以提供本地维修。在这种情况下,每前缀 LFA 可用于增加 OSPF 协议的本地维修覆盖范围。
在 OSPF 接口上启用链路保护或节点链路保护时,Junos OS 会为遍历受保护接口的所有目标路由创建到主下一跳跃的备用路径。
为 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.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.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-to-g 配置为受保护 OSPF 接口的备份 LSP。出口路由器配置了 IP 地址 192.168.1.4。
[edit] protocols { mpls { label-switched-path f-to-g { to 192.168.1.4; backup; } } }
示例:为 OSPF 配置无环路替代路由
此示例演示了对已启用 OSPF 的接口使用链路保护。
启用链路保护时,Junos OS 会为遍历受保护接口的所有目标路由创建到主下一跳跃的备用路径。假设只有一个链路可能不可用但相邻的节点仍可通过另一个接口可用时,请使用链路保护。
要求
配置此示例之前,无需设备初始化以外的特殊配置。
概述
在此示例中,配置了六个 OSPF 邻接方的链路保护。这样,Junos OS 便可为遍历每个受保护接口的所有目标路由创建到主下一跳跃的替代路径。此处使用链路保护,因为即使链路不可用,邻接节点仍将通过另一个接口可用。
示例显示两个拓扑。一个是默认拓扑,另一个是语音拓扑。有关多拓扑路由的详细信息,请参阅 多拓扑路由用户指南。
该示例还包括配置为受保护 OSPF 接口的备份 LSP 的 RSVP LSP。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,移除任何换行符,更改与网络配置匹配所需的任何详细信息,然后将命令复制粘贴到层次结构级别的 [edit]
CLI 中。
设备 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
使用保护机制时配置该语句。这包括 MPLS RSVP 保护,如快速重新路由 (FRR) 以及内部网关协议 (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 网络中 LDP 隧道上的远程 LFA 概述
在 OSPF 网络中,无环路备选 (LFA) 是直接连接的邻接方,可通过本地维修点 (PLR) 上的受保护链路为目标提供预先计算的备份路径。远程 LFA 未直接连接到 PLR,并且使用动态创建的 LDP 隧道到远程 LFA 节点提供预先计算的备份路径。主链路发生故障时,PLR 使用此远程 LFA 备份路径。远程 LFA 的主要目标是增加 OSPF 网络的备份覆盖范围,并为第 1 层城域环提供保护。
FLA 不能为 OSPF 网络提供完全的备份覆盖范围。对于通常被塑造成环形拓扑的城域以太网网络来说,这是一个重大挫折。为了克服这一挫折,资源预留协议 - 流量工程 (RSVP-TE) 备份隧道通常用于扩展备份覆盖范围。但是,大多数网络提供商已将 LDP 作为 MPLS 隧道设置协议实施,不想仅仅为了备份覆盖而实施 RSVP-TE 协议。LDP 会自动将传输隧道引入 OSPF 网络中的所有潜在目标,因此成为首选协议。为 MPLS 隧道设置实施的现有 LDP 可重复使用,以便保护 OSPF 网络和后续 LDP 目标,从而无需 RSVP-TE 备份隧道以实现备份覆盖。
要计算远程 LFA 备份路径,OSPF 协议将以以下方式确定远程 LFA 节点:
先从相邻路由器上计算反向最短路径,穿过受保护的 PLR 链路。反向最短路径首先使用传入链路指标而不是传出链路指标到达相邻节点。
结果是一组链路和节点,这是从每个叶节点到根节点的最短路径。
先计算其余相邻路由器上最短路径优先 (SPF),以查找无需遍历受保护链路即可到达的节点列表。
结果是在从根节点到所有叶节点的最短路径上的另一组链路和节点。
从上述结果中确定通用节点。这些节点是远程 FLA。
OSPF 侦听 LDP 路由的通告标签。对于每个通告的 LDP 路由,OSPF 检查是否包含下一跳跃提供的 LDP。如果相应的 OSPF 路由确实有备份下一跳跃,则 OSPF 将运行备份策略,并添加一个附加跟踪路由,并使用相应的 LDP 标签交换路径下一跳跃作为备份下一跳跃。如果没有备份下一跳跃,LDP 将建立一个动态 LDP 隧道以传输到远程 LFA,而 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 可能容易受到自动定向邻接的影响,并且可以使用以下全部或部分机制缓解这些威胁:
距离多个跃点的远程 FFA 使用扩展 hello 消息表示愿意建立有针对性的 LDP 会话。远程 LFA 可以过滤被欺骗的扩展 hello 消息,并且仅接受来自访问或过滤器列表允许的来源的短信,从而减少欺骗性的扩展 hello 消息的威胁。
需要使用应用组或 LDP 全球级身份验证,使用给定 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 自动定向邻接的远程邻接方的路由器发送定向 hello 消息。
在 PLR 上配置链路保护或节点链路保护。
要在 OSPF 网络中的 LDP 隧道上配置远程 LFA 备份:
另请参阅
示例:在 OSPF 网络中通过 LDP 隧道配置远程 LFA
在 OSPF 网络中,无环路备选 (LFA) 是直接连接的邻接方,可为通过本地维修点 (PLR) 上的受保护链路到达的目标提供预先计算的备份路径。远程 LFA 未直接连接到 PLR,并且使用动态创建的 LDP 隧道到远程 LFA 节点提供预先计算的备份路径。主链路发生故障时,PLR 使用此远程 LFA 备份路径。远程 LFA 的主要目标是增加 OSPF 网络的备份覆盖范围,并为第 1 层城域环提供保护。此示例说明如何在 OSPF 网络中为 LDP 隧道配置远程 LFA,以扩展备份保护。
要求
此示例使用以下硬件和软件组件:
-
九个在连接接口上启用了 OSPF 协议和 LDP 的 MX 系列路由器。
-
在所有设备上运行的 Junos OS 15.1 或更高版本。
在 OSPF 网络中通过 LDP 隧道配置远程 LFA 之前,请确保以下事项:
-
LDP 在环路接口上启用。没有环路接口,就无法形成 LDP 定向邻接。如果没有 LDP 定向邻接,就无法配置远程 LFA。
-
远程 LFA 必须允许不对称远程邻接方发现,也就是说,它必须定期向发起 LDP 自动定向邻接的远程邻接方的路由器发送定向查询。
-
必须在本地维修点 (PLR) 上配置链路保护或节点链路保护。
概述
该示例中包含九个环形拓扑结构的路由器。在直接连接的接口上配置 OSPF 协议。设备 R6 是 PLR。此示例可以验证 Junos OS 是否更新了设备 R6 的路由表,其中 LDP 下一跃点路由作为备份路由。
配置
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
R 2
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
-
指定目标 LDP 会话在远程 LFA 中断时保持的时间间隔,并指定自动、有针对性的 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.0 区域的备份邻接方。