3 层 VPN 中的提供商边缘链路保护
本主题将介绍配置预计算保护路径并提供示例,该路径可在 CE 路由器和备用 PE 路由器之间提供链路保护和备份路径。
了解对 BGP 标记的单播路径的提供商边缘链路保护
在 MPLS 服务提供商网络中,当第 3 层 VPN 用于运营商的运营商部署时,用于链接一个自治系统 (AS) 中的客户边缘 (CE) 路由器和另一个 AS 中的提供商边缘 (PE) 路由器的协议为 BGP 标签单播。AS 之间的重新路由解决方案对于帮助服务提供商确保网络中断对通过网络的数据流的影响最小至关重要。作为其他服务提供商客户的服务提供商可以拥有不同的 CE 路由器,这些路由器通过不同的 PE 路由器连接到其他服务提供商。此设置可实现流量负载平衡。但是,如果一台 CE 路由器与一台 PE 路由器之间的链路中断,则可能会导致流量中断。因此,应配置预先计算的保护路径,以便在 CE 路由器与 PE 路由器之间的链路出现故障时,可以使用其他 CE 路由器与备用 PE 路由器之间的保护路径(也称为备份路径)。
要将带标签的单播路径配置为保护路径,请在[edit routing-instances instance-name protocols bgp family inet labeled-unicast]层次结构级别使用语protection句:
routing-instances {
customer {
instance-type vrf;
...
protocols {
bgp {
family inet {
labeled-unicast {
protection;
}
}
family inet6 {
labeled-unicast {
protection;
}
}
type external;
...
}
}
}
}
该 protection 语句指示需要对从特定邻居或家族接收的前缀进行保护。为给定的家庭、组或邻居启用保护后,将为从给定对等方接收的前缀或下一跃点添加保护条目。
仅当 BGP 已在转转发表中安装最佳路径时,才能选择保护路径。这是因为保护路径不能用作最佳路径。
要在受保护路径关闭时将数据包丢失降至最低,还要在[edit routing-instances instance-name protocols bgp family inet labeled-unicast]层次结构级别使用per-prefix-label语句。在包含受保护路径的 AS 中的每个 PE 路由器上设置此语句。
保护路径选择基于两个状态标志的值进行:
该
ProtectionPath标志表示需要保护的路径。该
ProtectionCand标志指示可用作保护路径的路由条目。
提供商边缘链路保护仅配置为外部对等方。
如果使用
equal-external-internalmultipath 语句配置了提供商边缘链路保护,则多路径优先于保护。
了解 3 层 VPN 中的提供商边缘链路保护
在 MPLS 服务提供商网络中,客户可以拥有双宿主 CE 路由器,这些路由器通过不同的 PE 路由器连接到服务提供商。此设置可在服务提供商网络中实现流量负载平衡。但是,如果 CE 路由器和 PE 路由器之间的链路中断,这可能会导致流量中断。因此,应配置预先计算的保护路径,以便在 CE 路由器与 PE 路由器之间的链路出现故障时,可使用 CE 路由器与备用 PE 路由器之间的保护路径(也称为备份路径)。
要将路径配置为保护路径,请在[edit routing-instances instance-name protocols bgp family inet unicast]层次结构级别使用语protection句:
routing-instances {
customer {
instance-type vrf;
...
protocols {
bgp {
type external;
...
family inet {
unicast {
protection;
}
}
family inet6 {
unicast {
protection;
}
}
}
}
}
}
该 protection 语句指示需要对从特定邻居或家庭收到的前缀进行保护。为给定的家庭、组或邻居启用保护后,将为从给定对等方接收的前缀或下一跃点添加保护条目。
仅当 BGP 已在转转发表中安装最佳路径时,才能选择保护路径。这是因为保护路径不能用作最佳路径。
必须在具有受保护 PE-CE 链路的路由器的层次结构下[routing-instances instance-name]配置选项vrf-table-label。这适用于 Junos OS 12.3 到 13.2 版(含)。
保护路径选择基于两个状态标志的值进行:
该
ProtectionPath标志表示请求保护的路径。该
ProtectionCand标志指示可用作保护路径的路由条目。
提供商边缘链路保护仅配置为外部对等方。
如果使用
equal-external-internalmultipath 语句配置了提供商边缘链路保护,则多路径优先于保护。
示例:在第 3 层 VPN 中配置提供商边缘链路保护
此示例说明如何配置可在 MPLS 网络中发生链路故障时使用的提供商边缘保护路径。
要求
此示例使用以下硬件组件、软件组件和配置选项:
-
M Series 多服务边缘路由器、MX 系列 5G 通用路由平台或 T Series 核心路由器
-
Junos OS 12.3 到 13.2(含)
-
必须为具有受保护 PE-CE 链路的路由器在
[routing-instances instance-name]层次结构级别启用该选项vrf-table-label。
概述
以下示例说明如何在第 3 层 VPN 中配置提供商边缘链路保护。
拓扑学
在此示例中,通过在四个自治系统中配置三个客户边缘设备和三个服务提供商边缘设备来设置第 3 层 VPN。CE 设备配置在 AS 64496、AS 64498 和 AS 64499 中。PE 设备在 AS 64497 中配置。
图 1 显示了此示例中使用的拓扑。
中的提供商边缘链路保护
此示例的目的是保护路由器 PE3 和 CE2 之间的提供商边缘链路。您可以在路由器 PE3 和 CE2 之间的主链路上配置保护,方法是在 PE3-CE2 链路出现故障时通过 PE2-CE2 的备份链路路由流量。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层 [edit] 级的 CLI 中。
路由器 CE1
set interfaces ge-2/0/0 unit 0 description toPE1
set interfaces ge-2/0/0 unit 0 family inet address 10.1.1.1/30
set interfaces ge-2/0/0 unit 0 family inet6 address 2001:db8:0:1::/64 eui-64
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.1/24
set interfaces lo0 unit 0 family inet6 address 2001:db8::1/128
set routing-options router-id 192.0.2.1
set routing-options autonomous-system 64496
set protocols bgp group toPE1 type external
set protocols bgp group toPE1 export send-direct
set protocols bgp group toPE1 peer-as 64497
set protocols bgp group toPE1 neighbor 10.1.1.2
set policy-options policy-statement send-direct from protocol direct
set policy-options policy-statement send-direct then accept
路由器 PE1
set interfaces ge-2/0/0 unit 0 description toCE1
set interfaces ge-2/0/0 unit 0 family inet address 10.1.1.2/30
set interfaces ge-2/0/0 unit 0 family inet6 address 2001:db8:0:1::/64 eui-64
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toPE2
set interfaces ge-2/0/1 unit 0 family inet address 10.1.1.5/30
set interfaces ge-2/0/1 unit 0 family inet6 address 2001:db8:0:5::/64 eui-64
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces ge-2/0/2 unit 0 description toPE3
set interfaces ge-2/0/2 unit 0 family inet address 10.1.1.9/30
set interfaces ge-2/0/2 unit 0 family inet6 address 2001:db8:0:9::/64 eui-64
set interfaces ge-2/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.2/24
set interfaces lo0 unit 0 family inet6 address 2001:db8::2/128
set protocols mpls interface all
set protocols ldp interface all
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/1.0 metric 10
set protocols ospf area 0.0.0.0 interface ge-2/0/2.0 metric 10
set protocols ospf3 area 0.0.0.0 interface lo0.0 passive
set protocols ospf3 area 0.0.0.0 interface ge-2/0/1.0 metric 10
set protocols ospf3 area 0.0.0.0 interface ge-2/0/2.0 metric 10
set protocols bgp group toInternal type internal
set protocols bgp group toInternal family inet-vpn unicast
set protocols bgp group toInternal family inet6-vpn unicast
set protocols bgp group toInternal multipath
set protocols bgp group toInternal local-address 192.0.2.2
set protocols bgp group toInternal neighbor 192.0.2.3
set protocols bgp group toInternal neighbor 192.0.2.4
set routing-options router-id 192.0.2.2
set routing-options autonomous-system 64497
set routing-options forwarding-table export lb
set routing-instances radium instance-type vrf
set routing-instances radium interface ge-2/0/0.0
set routing-instances radium route-distinguisher 64497:1
set routing-instances radium vrf-target target:64497:1
set routing-instances radium protocols bgp group toCE1 type external
set routing-instances radium protocols bgp group toCE1 peer-as 64496
set routing-instances radium protocols bgp group toCE1 neighbor 10.1.1.1
set policy-options policy-statement lb then load-balance per-packet
路由器 PE2
set interfaces ge-2/0/0 unit 0 description toPE1
set interfaces ge-2/0/0 unit 0 family inet address 10.1.1.6/30
set interfaces ge-2/0/0 unit 0 family inet6 address 2001:db8:0:5::/64 eui-64
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toP
set interfaces ge-2/0/1 unit 0 family inet address 10.1.1.13/30
set interfaces ge-2/0/1 unit 0 family inet6 address 2001:db8:0:13::/64 eui-64
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces ge-2/0/2 unit 0 description toCE2
set interfaces ge-2/0/2 unit 0 family inet address 10.1.1.29/30
set interfaces ge-2/0/2 unit 0 family inet6 address 2001:db8:0:29::/64 eui-64
set interfaces ge-2/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.3/24
set interfaces lo0 unit 0 family inet6 address 2001:db8::3/128
set protocols mpls interface all
set protocols ldp interface all
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/0.0 metric 10
set protocols ospf area 0.0.0.0 interface ge-2/0/1.0 metric 5
set protocols ospf3 area 0.0.0.0 interface lo0.0 passive
set protocols ospf3 area 0.0.0.0 interface ge-2/0/0.0 metric 10
set protocols ospf3 area 0.0.0.0 interface ge-2/0/1.0 metric 5
set protocols bgp group toInternal type internal
set protocols bgp group toInternal family inet-vpn unicast
set protocols bgp group toInternal family inet6-vpn unicast
set protocols bgp group toInternal multipath
set protocols bgp group toInternal local-address 192.0.2.3
set protocols bgp group toInternal neighbor 192.0.2.2
set protocols bgp group toInternal neighbor 192.0.2.4
set routing-options router-id 192.0.2.3
set routing-options autonomous-system 64497
set routing-options forwarding-table export lb
set routing-instances radium instance-type vrf
set routing-instances radium interface ge-2/0/2.0
set routing-instances radium route-distinguisher 64497:1
set routing-instances radium vrf-target target:64497:1
set routing-instances radium protocols bgp group toCE2 type external
set routing-instances radium protocols bgp group toCE2 peer-as 64498
set routing-instances radium protocols bgp group toCE2 neighbor 10.1.1.30
set policy-options policy-statement lb then load-balance per-packet
路由器 PE3
set interfaces ge-2/0/0 unit 0 description toPE1
set interfaces ge-2/0/0 unit 0 family inet address 10.1.1.10/30
set interfaces ge-2/0/0 unit 0 family inet6 address 2001:db8:0:9::/64 eui-64
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toP
set interfaces ge-2/0/1 unit 0 family inet address 10.1.1.18/30
set interfaces ge-2/0/1 unit 0 family inet6 address 2001:db8:0:17::/64 eui-64
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces ge-2/0/2 unit 0 description toCE2
set interfaces ge-2/0/2 unit 0 family inet address 10.1.1.25/30
set interfaces ge-2/0/2 unit 0 family inet6 address 2001:db8:0:25::/64 eui-64
set interfaces ge-2/0/2 unit 0 family mpls
set interfaces ge-2/0/3 unit 0 description toCE3
set interfaces ge-2/0/3 unit 0 family inet address 10.1.1.21/30
set interfaces ge-2/0/3 unit 0 family inet6 address 2001:db8:0:21::/64 eui-64
set interfaces ge-2/0/3 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.4/24
set interfaces lo0 unit 0 family inet6 address 2001:db8::4/128
set protocols mpls interface all
set protocols ldp interface all
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/1.0 metric 5
set protocols ospf area 0.0.0.0 interface ge-2/0/0.0 metric 10
set protocols ospf3 area 0.0.0.0 interface lo0.0 passive
set protocols ospf3 area 0.0.0.0 interface ge-2/0/1.0 metric 5
set protocols ospf3 area 0.0.0.0 interface ge-2/0/0.0 metric 10
set protocols bgp group toInternal type internal
set protocols bgp group toInternal family inet-vpn unicast
set protocols bgp group toInternal family inet6-vpn unicast
set protocols bgp group toInternal multipath
set protocols bgp group toInternal local-address 192.0.2.4
set protocols bgp group toInternal neighbor 192.0.2.2
set protocols bgp group toInternal neighbor 192.0.2.3
set routing-options router-id 192.0.2.4
set routing-options autonomous-system 64497
set routing-options forwarding-table export lb
set routing-instances radium instance-type vrf
set routing-instances radium vrf-table-label
set routing-instances radium interface ge-2/0/2.0
set routing-instances radium interface ge-2/0/3.0
set routing-instances radium route-distinguisher 64497:1
set routing-instances radium vrf-target target:64497:1
set routing-instances radium protocols bgp group toCE2 type external
set routing-instances radium protocols bgp group toCE2 peer-as 64498
set routing-instances radium protocols bgp group toCE2 neighbor 10.1.1.26
set routing-instances radium protocols bgp group toCE2 family inet unicast protection
set routing-instances radium protocols bgp group toCE2 family inet6 unicast protection
set routing-instances radium protocols bgp group toCE3 type external
set routing-instances radium protocols bgp group toCE3 peer-as 64499
set routing-instances radium protocols bgp group toCE3 neighbor 10.1.1.22
set policy-options policy-statement lb then load-balance per-packet
路由器 P
set interfaces ge-2/0/0 unit 0 description toPE2
set interfaces ge-2/0/0 unit 0 family inet address 10.1.1.14/30
set interfaces ge-2/0/0 unit 0 family inet6 address 2001:db8:0:13::/64 eui-64
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toPE3
set interfaces ge-2/0/1 unit 0 family inet address 10.1.1.17/30
set interfaces ge-2/0/1 unit 0 family inet6 address 2001:db8:0:17::/64 eui-64
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.5/24
set interfaces lo0 unit 0 family inet6 address 2001:db8::5/128
set routing-options router-id 192.0.2.5
set routing-options autonomous-system 64497
set protocols mpls interface all
set protocols ldp interface all
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/0.0 metric 5
set protocols ospf area 0.0.0.0 interface ge-2/0/1.0 metric 5
set protocols ospf3 area 0.0.0.0 interface lo0.0 passive
set protocols ospf3 area 0.0.0.0 interface ge-2/0/0.0 metric 5
set protocols ospf3 area 0.0.0.0 interface ge-2/0/1.0 metric 5
路由器 CE2
set interfaces ge-2/0/0 unit 0 description toPE2
set interfaces ge-2/0/0 unit 0 family inet address 10.1.1.30/30
set interfaces ge-2/0/0 unit 0 family inet6 address 2001:db8:0:29::/64 eui-64
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toPE3
set interfaces ge-2/0/1 unit 0 family inet address 10.1.1.26/30
set interfaces ge-2/0/1 unit 0 family inet6 address 2001:db8:0:25::/64 eui-64
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.6/24
set interfaces lo0 unit 0 family inet6 address 2001:db8::6/128
set routing-options router-id 192.0.2.6
set routing-options autonomous-system 64498
set protocols bgp group toAS2 type external
set protocols bgp group toAS2 export send-direct
set protocols bgp group toAS2 peer-as 64497
set protocols bgp group toAS2 neighbor 10.1.1.25
set protocols bgp group toAS2 neighbor 10.1.1.29
set policy-options policy-statement send-direct from protocol direct
set policy-options policy-statement send-direct then accept
路由器 CE3
set interfaces ge-2/0/0 unit 0 description toPE3
set interfaces ge-2/0/0 unit 0 family inet address 10.1.1.22/30
set interfaces ge-2/0/0 unit 0 family inet6 address 2001:db8:0:21::/64 eui-64
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.7/24
set interfaces lo0 unit 0 family inet6 address 2001:db8::7/128
set routing-options router-id 192.0.2.7
set routing-options autonomous-system 64499
set protocols bgp group toPE3 type external
set protocols bgp group toPE3 export send-direct
set protocols bgp group toPE3 peer-as 64497
set protocols bgp group toPE3 neighbor 10.1.1.21
set policy-options policy-statement send-direct from protocol direct
set policy-options policy-statement send-direct then accept
在第 3 层 VPN 中配置提供商边缘链路保护
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置提供商边缘链路保护,请执行以下作:
-
配置路由器接口。
[edit interfaces] user@PE3# set ge-2/0/0 unit 0 description toPE1 user@PE3# set ge-2/0/0 unit 0 family inet address 10.1.1.10/30 user@PE3# set ge-2/0/0 unit 0 family inet6 address 2001:db8:0:9::/64 eui-64 user@PE3# set ge-2/0/0 unit 0 family mplsuser@PE3# set ge-2/0/1 unit 0 description toP user@PE3# set ge-2/0/1 unit 0 family inet address 10.1.1.18/30 user@PE3# set ge-2/0/1 unit 0 family inet6 address 2001:db8:0:17::/64 eui-64 user@PE3# set ge-2/0/1 unit 0 family mplsuser@PE3# set ge-2/0/2 unit 0 description toCE2 user@PE3# set ge-2/0/2 unit 0 family inet address 10.1.1.25/30 user@PE3# set ge-2/0/2 unit 0 family inet6 address 12001:db8:0:25::/64 eui-64 user@PE3# set ge-2/0/2 unit 0 family mplsuser@PE3# set ge-2/0/3 unit 0 description toCE3 user@PE3# set ge-2/0/3 unit 0 family inet address 10.1.1.21/30 user@PE3# set ge-2/0/3 unit 0 family inet6 address 2001:db8:0:21::/64 eui-64 user@PE3# set ge-2/0/3 unit 0 family mplsuser@PE3# set lo0 unit 0 family inet address 192.0.2.4/24 user@PE3# set lo0 unit 0 family inet6 address 2001:db8::4/128同样地,在所有其他路由器上配置接口。
-
配置路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@PE3# set router-id 192.0.2.4 user@PE3# set autonomous-system 64497同样,为所有其他路由器配置路由器 ID 和 AS 编号。在此示例中,选择的路由器 ID 与路由器上配置的环路地址相同。
-
在路由器 PE3 的所有接口上配置 MPLS 和 LDP。
[edit protocols] user@PE3# set mpls interface all user@PE3# set ldp interface all同样,配置其他 PE 路由器。
-
在路由器 PE3 面向核心的接口上配置 IGP。
[edit protocols ospf area 0.0.0.0] user@PE3# set interface lo0.0 passive user@PE3# set interface ge-2/0/1.0 metric 5 user@PE3# set interface ge-2/0/0.0 metric 10[edit protocols ospf3 area 0.0.0.0] user@PE3# set interface lo0.0 passive user@PE3# set interface ge-2/0/1.0 metric 5 user@PE3# set interface ge-2/0/0.0 metric 10同样,配置其他 PE 路由器。
-
配置一个策略,将路由从路由表导出到路由器 PE3 上的转转发表。
[edit policy-options] user@PE3# set policy-statement lb then load-balance per-packet[edit routing-options] user@PE3# set forwarding-table export lb同样,配置其他 PE 路由器。
-
在路由器 CE2 上配置 BGP,并包括用于导出与服务提供商网络之间的路由的策略。
[edit policy-options] user@CE2# set policy-statement send-direct from protocol direct user@CE2# set policy-statement send-direct then accept[edit protocols bgp group toAS2] user@CE2# set type external user@CE2# set export send-direct user@CE2# set peer-as 64497 user@CE2# set neighbor 10.1.1.25 user@CE2# set neighbor 10.1.1.29同样地,配置其他 CE 路由器。
-
在路由器 PE3 上配置 BGP,以便在提供商核心内进行路由。
[edit protocols bgp group toInternal] user@PE3# set type internal user@PE3# set family inet-vpn unicast user@PE3# set family inet6-vpn unicast user@PE3# set multipath user@PE3# set local-address 192.0.2.4 user@PE3# set neighbor 192.0.2.2 user@PE3# set neighbor 192.0.2.3同样,配置其他 PE 路由器。
-
在路由器 PE3 上配置第 3 层 VPN 路由实例。
[set routing-instances radium] user@PE3# set instance-type vrf user@PE3# set vrf-table-label user@PE3# set interface ge-2/0/2.0 user@PE3# set interface ge-2/0/3.0 user@PE3# set route-distinguisher 64497:1 user@PE3# set vrf-target target:64497:1[edit routing-instances radium protocols bgp group toCE2] user@PE3# set type external user@PE3# set peer-as 64498 user@PE3# set neighbor 10.1.1.26[edit routing-instances radium protocols bgp group toCE3] user@PE3# set type external user@PE3# set peer-as 64499 user@PE3# set neighbor 10.1.1.22同样,配置其他 PE 路由器。
-
在路由器 PE3 和 CE2 之间的链路上配置提供商边缘链路保护。
[edit routing-instances radium protocols bgp group toCE2] user@PE3# set family inet unicast protection user@PE3# set family inet6 unicast protection
结果
在配置模式下,输入show interfaces、 show protocols show routing-optionsshow policy-options和show routing-instances命令,以确认您的配置。
如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@PE3# show interfaces
ge-2/0/0 {
unit 0 {
description toPE1;
family inet {
address 10.1.1.10/30;
}
family inet6 {
address 2001:db8:0:9::/64 {
eui-64;
}
}
family mpls;
}
}
ge-2/0/1 {
unit 0 {
description toP;
family inet {
address 10.1.1.18/30;
}
family inet6 {
address 2001:db8:0:17::/64 {
eui-64;
}
}
family mpls;
}
}
ge-2/0/2 {
unit 0 {
description toCE2;
family inet {
address 10.1.1.25/30;
}
family inet6 {
address 2001:db8:0:25::/64 {
eui-64;
}
}
family mpls;
}
}
ge-2/0/3 {
unit 0 {
description toCE3;
family inet {
address 10.1.1.21/30;
}
family inet6 {
address 2001:db8:0:21::/64 {
eui-64;
}
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 192.0.2.4/24;
}
family inet6 {
address 2001:db8::4/128;
}
}
}
user@PE3# show routing-options
router-id 192.0.2.4;
autonomous-system 64497;
forwarding-table {
export lb;
}
user@PE3# show policy-options
policy-statement lb {
then {
load-balance per-packet;
}
}
user@PE3# show protocols
mpls {
interface all;
}
bgp {
group toInternal {
type internal;
local-address 192.0.2.4;
family inet-vpn {
unicast;
}
family inet6-vpn {
unicast;
}
multipath;
neighbor 192.0.2.2;
neighbor 192.0.2.3;
}
}
ospf {
area 0.0.0.0 {
interface lo0.0 {
passive;
}
interface ge-2/0/1.0 {
metric 5;
}
interface ge-2/0/0.0 {
metric 10;
}
}
}
ospf3 {
area 0.0.0.0 {
interface lo0.0 {
passive;
}
interface ge-2/0/1.0 {
metric 5;
}
interface ge-2/0/0.0 {
metric 10;
}
}
}
ldp {
interface all;
}
user@PE3# show routing-instances
radium {
instance-type vrf;
interface ge-2/0/2.0;
interface ge-2/0/3.0;
route-distinguisher 64497:1;
vrf-target target:64497:1;
protocols {
bgp {
group toCE2 {
type external;
family inet {
unicast {
protection;
}
}
family inet6 {
unicast {
protection;
}
}
peer-as 64498;
neighbor 10.1.1.26;
}
group toCE3 {
type external;
peer-as 64499;
neighbor 10.1.1.22;
}
}
}
}
在所有其他路由器上运行这些命令以确认配置。如果完成路由器配置,请从配置模式输入 commit 。
验证
确认配置工作正常。
验证 BGP
目的
验证 BGP 在第 3 层 VPN 中是否正常工作。
行动
在路由器 PE3 上的作模式下,运行 show route protocol bgp 命令。
user@PE3> show route protocol bgp
inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
inet.3: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
radium.inet.0: 9 destinations, 14 routes (9 active, 0 holddown, 0 hidden)
@ = Routing Use Only, # = Forwarding Use Only
+ = Active Route, - = Last Active, * = Both
192.0.2.1/24 *[BGP/170] 00:09:15, localpref 100, from 192.0.2.2
AS path: 64496 I, validation-state: unverified
> to 10.1.1.9 via ge-2/0/0.0, Push 299792
192.0.2.6/24 @[BGP/170] 00:09:40, localpref 100
AS path: 64498 I, validation-state: unverified
> to 10.1.1.26 via ge-2/0/2.0
[BGP/170] 00:09:07, localpref 100, from 192.0.2.3
AS path: 64498 I, validation-state: unverified
> to 10.1.1.17 via ge-2/0/1.0, Push 299792, Push 299776(top)
192.0.2.7/24 *[BGP/170] 00:09:26, localpref 100
AS path: 64499 I, validation-state: unverified
> to 10.1.1.22 via ge-2/0/3.0
10.1.1.0/30 *[BGP/170] 00:09:15, localpref 100, from 192.0.2.2
AS path: I, validation-state: unverified
> to 10.1.1.9 via ge-2/0/0.0, Push 299792
10.1.1.20/30 [BGP/170] 00:09:26, localpref 100
AS path: 64499 I, validation-state: unverified
> to 10.1.1.22 via ge-2/0/3.0
10.1.1.24/30 [BGP/170] 00:09:40, localpref 100
AS path: 64498 I, validation-state: unverified
> to 10.1.1.26 via ge-2/0/2.0
10.1.1.28/30 *[BGP/170] 00:09:07, localpref 100, from 192.0.2.3
AS path: I, validation-state: unverified
> to 10.1.1.17 via ge-2/0/1.0, Push 299792, Push 299776(top)
[BGP/170] 00:09:40, localpref 100
AS path: 64498 I, validation-state: unverified
> to 10.1.1.26 via ge-2/0/2.0
mpls.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
bgp.l3vpn.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
64497:1:192.0.2.1/24
*[BGP/170] 00:09:15, localpref 100, from 192.0.2.2
AS path: 64496 I, validation-state: unverified
> to 10.1.1.9 via ge-2/0/0.0, Push 299792
64497:1:192.0.2.6/24
*[BGP/170] 00:09:07, localpref 100, from 192.0.2.3
AS path: 64498 I, validation-state: unverified
> to 10.1.1.17 via ge-2/0/1.0, Push 299792, Push 299776(top)
64497:1:10.1.1.0/30
*[BGP/170] 00:09:15, localpref 100, from 192.0.2.2
AS path: I, validation-state: unverified
> to 10.1.1.9 via ge-2/0/0.0, Push 299792
64497:1:10.1.1.28/30
*[BGP/170] 00:09:07, localpref 100, from 192.0.2.3
AS path: I, validation-state: unverified
> to 10.1.1.17 via ge-2/0/1.0, Push 299792, Push 299776(top)
inet6.0: 12 destinations, 13 routes (12 active, 0 holddown, 0 hidden)
radium.inet6.0: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden)
输出显示路由器 PE3 的路由表中的所有 BGP 路由。这表示 BGP 正在按要求运行。
同样,在其他路由器上运行此命令,以检查 BGP 是否正常运行。
意义
BGP 在第 3 层 VPN 中正常运行。
验证提供商边缘链路保护
目的
验证路由器 PE2 和 CE2 之间的提供商边缘链路是否受到保护。
行动
要验证提供商边缘链路保护配置是否正确,请执行以下作:
-
确认路由器 CE2 上的路由已直接或通过路由器 PE2 播发至路由器 PE3。
如果路由播发正确,您将看到路由的多个路径。
在路由器 PE3 上的作模式下,运行
show route destination-prefix命令。user@PE3> show route 192.0.2.6 radium.inet.0: 9 destinations, 14 routes (9 active, 0 holddown, 0 hidden) @ = Routing Use Only, # = Forwarding Use Only + = Active Route, - = Last Active, * = Both 192.0.2.6/24 @[BGP/170] 02:55:36, localpref 100 AS path: 64498 I, validation-state: unverified > to 10.1.1.26 via ge-2/0/2.0 [BGP/170] 00:10:13, localpref 100, from 192.0.2.3 AS path: 64498 I, validation-state: unverified > to 10.1.1.17 via ge-2/0/1.0, Push 299840, Push 299776(top) #[Multipath/255] 00:10:13 > to 10.1.1.26 via ge-2/0/2.0 to 10.1.1.17 via ge-2/0/1.0, Push 299840, Push 299776(top)输出验证路由器 CE2 上是否存在从路由器 PE3 到目标路由 192.0.2.6的多条路径。第一条路径直接通过 PE3-CE2 链路 (10.1.1.26)。第二条路径是通过提供商核心和 PE2 (10.1.1.17)。
-
通过确认要保护的活动路径的权重为
0x1,以及保护候选路径的权重为0x4000,来验证保护路径配置是否正确。在路由器 PE3 上的作模式下,运行
show route destination-prefix extensive命令。user@PE3> show route 192.0.2.6 extensive radium.inet.0: 9 destinations, 14 routes (9 active, 0 holddown, 0 hidden) 192.0.2.6/24 (3 entries, 2 announced) State: <CalcForwarding> TSI: KRT in-kernel 192.0.2.6/24 -> {list:10.1.1.26, indirect(1048584)} Page 0 idx 1 Type 1 val 9229c38 Nexthop: Self AS path: [64497] 64498 I Communities: Page 0 idx 2 Type 1 val 9229cc4 Flags: Nexthop Change Nexthop: Self Localpref: 100 AS path: [64497] 64498 I Communities: target:64497:1 Path 192.0.2.6 from 10.1.1.26 Vector len 4. Val: 1 2 @BGP Preference: 170/-101 Next hop type: Router, Next hop index: 994 Address: 0x9240a74 Next-hop reference count: 5 Source: 10.1.1.26 Next hop: 10.1.1.26 via ge-2/0/2.0, selected Session Id: 0x200001 State: <Active Ext ProtectionPath ProtectionCand> Peer AS: 64498 Age: 2:55:54 Validation State: unverified Task: BGP_64498.10.1.1.26+52214 Announcement bits (1): 2-BGP_RT_Background AS path: 64498 I Accepted Localpref: 100 Router ID: 192.0.2.6 BGP Preference: 170/-101 Route Distinguisher: 64497:1 Next hop type: Indirect Address: 0x92413a8 Next-hop reference count: 6 Source: 192.0.2.3 Next hop type: Router, Next hop index: 1322 Next hop: 10.1.1.17 via ge-2/0/1.0, selected Label operation: Push 299840, Push 299776(top) Label TTL action: prop-ttl, prop-ttl(top) Session Id: 0x200005 Protocol next hop: 192.0.2.3 Push 299840 Indirect next hop: 94100ec 1048584 INH Session ID: 0x20000b State: <Secondary NotBest Int Ext ProtectionCand> Inactive reason: Not Best in its group - Interior > Exterior > Exterior via Interior Local AS: 64497 Peer AS: 64497 Age: 10:31 Metric2: 1 Validation State: unverified Task: BGP_64497.192.0.2.3+179 Local AS: 64497 Peer AS: 64497 Age: 10:31 Metric2: 1 Validation State: unverified Task: BGP_64497.192.0.2.3+179 AS path: 64498 I Communities: target:64497:1 Import Accepted VPN Label: 299840 Localpref: 100 Router ID: 192.0.2.3 Primary Routing Table bgp.l3vpn.0 Indirect next hops: 1 Protocol next hop: 192.0.2.3 Metric: 1 Push 299840 Indirect next hop: 94100ec 1048584 INH Session ID: 0x20000b Indirect path forwarding next hops: 1 Next hop type: Router Next hop: 10.1.1.17 via ge-2/0/1.0 Session Id: 0x200005 192.0.2.3/24 Originating RIB: inet.3 Metric: 1 Node path count: 1 Forwarding nexthops: 1 Nexthop: 10.1.1.17 via ge-2/0/1.0 #Multipath Preference: 255 Next hop type: List, Next hop index: 1048585 Address: 0x944c154 Next-hop reference count: 2 Next hop: ELNH Address 0x9240a74 weight 0x1, selected equal-external-internal-type external Next hop type: Router, Next hop index: 994 Address: 0x9240a74 Next-hop reference count: 5 Next hop: 10.1.1.26 via ge-2/0/2.0 Next hop: ELNH Address 0x92413a8 weight 0x4000 equal-external-internal-type internal Next hop type: Indirect Address: 0x92413a8 Next-hop reference count: 6 Protocol next hop: 192.0.2.3 Push 299840 Indirect next hop: 94100ec 1048584 INH Session ID: 0x20000b Next hop type: Router, Next hop index: 1322 Address: 0x9241310 Next-hop reference count: 4 Next hop: 10.1.1.17 via ge-2/0/1.0 Label operation: Push 299840, Push 299776(top) Label TTL action: prop-ttl, prop-ttl(top) State: <ForwardingOnly Int Ext> Inactive reason: Forwarding use only Age: 10:31 Validation State: unverified Task: RT Announcement bits (1): 0-KRT AS path: 64498 I输出显示,分配给 PE3-CE2 路径的权重 (0x1) 优于分配给 PE2-CE2 路径的 (0x4000) 权重。较低的权重值优先于较高的权重值。这确认了 PE3-CE2 路径受 PE2-CE2 路径保护。
意义
路由器 PE3 和 CE2 之间的提供商边缘链路受到保护。
示例:为 BGP 标记的单播路径配置提供商边缘链路保护
此示例说明如何配置带标签的单播保护路径,以便在载波至载波拓扑中发生链路故障时使用该路径。
要求
此示例使用以下硬件和软件组件:
-
M Series 多服务边缘路由器、MX 系列 5G 通用路由平台或 T Series 核心路由器
-
Junos OS 13.3 或更高版本
概述
此示例说明如何在第 3 层 VPN 中配置带标签的单播链路保护。
拓扑学
在此示例中,通过在五个自治系统中配置两个客户边缘设备和八个服务提供商边缘设备来设置载波至载波拓扑。CE 设备配置在 AS100 和 AS101 中。PE 设备配置在 AS200、AS300 和 AS201 中。
图 2 显示了此示例中使用的拓扑。
中带标签的单播链路保护
此示例的目的是保护路由器 R4 和 R3 之间的提供商边缘链路。在 R4 和 R3 之间的主链路上配置了保护,以便在主链路出现故障时,流量可以通过备用链路(R11 到 R10)路由。
还可以在 R11 和 R10 之间的辅助链路上配置保护,这样,如果该链路成为主链路,而 R4-R3 链路成为辅助链路,则 R11-R10 链路也将受到保护。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层 [edit] 级的 CLI 中。
只有在提交初始配置且 BGP 在转转发表中安装了最佳路径后,才会将保护添加到配置中。
路由器 R0
set interfaces ge-2/0/0 unit 0 description toR1
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.1/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.1/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2056.00
set routing-options router-id 192.0.2.1
set routing-options autonomous-system 100
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/0.0 metric 10
路由器 R1
set interfaces ge-2/0/0 unit 0 description toR0
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.2/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR2
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.5/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.2/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2052.00
set routing-options router-id 192.0.2.2
set routing-options autonomous-system 200
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp interface ge-2/0/1.0
set protocols ldp interface lo0.0
set protocols ospf traffic-engineering
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/1.0 metric 10
set protocols bgp group toR8 local-address 192.0.2.2
set protocols bgp group toR8 type external
set protocols bgp group toR8 multihop ttl 10
set protocols bgp group toR8 family inet-vpn unicast
set protocols bgp group toR8 neighbor 192.0.2.9 peer-as 201
set policy-options policy-statement child_vpn_routes from protocol bgp
set policy-options policy-statement child_vpn_routes then accept
set routing-instances customer-provider-vpn instance-type vrf
set routing-instances customer-provider-vpn interface ge-2/0/0.0
set routing-instances customer-provider-vpn route-distinguisher 192.0.2.4:1
set routing-instances customer-provider-vpn vrf-target target:200:1
set routing-instances customer-provider-vpn protocols ospf export child_vpn_routes
set routing-instances customer-provider-vpn protocols ospf area 0.0.0.0 interface ge-2/0/0.0
路由器 R2
set interfaces ge-2/0/0 unit 0 description toR1
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.6/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR3
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.9/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces ge-2/0/2 unit 0 description toR10
set interfaces ge-2/0/2 unit 0 family inet address 10.1.0.37/30
set interfaces ge-2/0/2 unit 0 family iso
set interfaces ge-2/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.3/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2046.00
set routing-options router-id 192.0.2.3
set routing-options autonomous-system 200
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp interface ge-2/0/0.0
set protocols ldp interface ge-2/0/1.0
set protocols ldp interface ge-2/0/2.0
set protocols ldp interface lo0.0
set protocols ospf traffic-engineering
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/0.0 metric 10
set protocols ospf area 0.0.0.0 interface ge-2/0/1.0 metric 10
set protocols ospf area 0.0.0.0 interface ge-2/0/2.0 metric 10
路由器 R3
set interfaces ge-2/0/0 unit 0 description toR2
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.10/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR4
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.13/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.4/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2045.00
set routing-options router-id 192.0.2.4
set routing-options autonomous-system 200
set protocols mpls traffic-engineering bgp-igp
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp egress-policy from-bgp
set protocols ldp interface ge-2/0/0.0
set protocols ldp interface lo0.0
set protocols ospf traffic-engineering
set protocols ospf export from-bgp
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/0.0 metric 10
set protocols bgp group toR4 type external
set protocols bgp group toR4 import send-local
set protocols bgp group toR4 family inet labeled-unicast
set protocols bgp group toR4 export send-local
set protocols bgp group toR4 neighbor 10.1.0.14 peer-as 300
set policy-options policy-statement from-bgp from protocol bgp
set policy-options policy-statement from-bgp then metric add 100
set policy-options policy-statement from-bgp then accept
set policy-options policy-statement send-local term 2 from metric 100
set policy-options policy-statement send-local term 2 then reject
set policy-options policy-statement send-local then accept
路由器 R4
set interfaces ge-2/0/0 unit 0 description toR3
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.14/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR5
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.17/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.5/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2049.00
set policy-options policy-statement 1b then load-balance per-packet
set routing-options router-id 192.0.2.5
set routing-options autonomous-system 300
set routing-options forwarding-table export 1b
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp interface ge-2/0/1.0
set protocols ldp interface lo0.0
set protocols isis level 1 disable
set protocols isis level 2 wide-metrics-only
set protocols isis interface ge-2/0/1.0 level 2 metric 10
set protocols isis interface lo0.0 passive
set protocols bgp group parent-vpn-peers type internal
set protocols bgp group parent-vpn-peers local-address 192.0.2.5
set protocols bgp group parent-vpn-peers family inet-vpn unicast
set protocols bgp group parent-vpn-peers neighbor 192.0.2.7
set protocols bgp group parent-vpn-peers neighbor 192.0.2.12
set routing-instances coc-provider-vpn instance-type vrf
set routing-instances coc-provider-vpn interface ge-2/0/0.0
set routing-instances coc-provider-vpn interface ge-2/0/2.0
set routing-instances coc-provider-vpn route-distinguisher 192.0.2.5:1
set routing-instances coc-provider-vpn vrf-target target:300:1
set routing-instances coc-provider-vpn protocols bgp group toR3 type external
set routing-instances coc-provider-vpn protocols bgp group toR3 family inet labeled-unicast per-prefix-label
set routing-instances coc-provider-vpn protocols bgp group toR3 neighbor 10.1.0.13 peer-as 200
路由器 R5
set interfaces ge-2/0/0 unit 0 description toR4
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.18/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR6
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.21/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces ge-2/0/2 unit 0 description toR11
set interfaces ge-2/0/2 unit 0 family inet address 10.1.0.46/30
set interfaces ge-2/0/2 unit 0 family iso
set interfaces ge-2/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.6/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2050.00
set routing-options router-id 192.0.2.6
set routing-options autonomous-system 300
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp interface ge-2/0/0.0
set protocols ldp interface ge-2/0/1.0
set protocols ldp interface ge-2/0/2.0
set protocols ldp interface lo0.0
set protocols isis level 1 disable
set protocols isis level 2 wide-metrics-only
set protocols isis interface ge-2/0/0.0 level 2 metric 10
set protocols isis interface ge-2/0/1.0 level 2 metric 10
set protocols isis interface ge-2/0/2.0 level 2 metric 10
set protocols isis interface lo0.0 passive
路由器 R6
set interfaces ge-2/0/0 unit 0 description toR5
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.22/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR7
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.25/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.7/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2048.00
set routing-options router-id 192.0.2.7
set routing-options autonomous-system 300
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp interface ge-2/0/0.0
set protocols ldp interface lo0.0
set protocols isis level 1 disable
set protocols isis level 2 wide-metrics-only
set protocols isis interface ge-2/0/0.0 level 2 metric 10
set protocols isis interface lo0.0 passive
set protocols bgp group parent-vpn-peers type internal
set protocols bgp group parent-vpn-peers local-address 192.0.2.7
set protocols bgp group parent-vpn-peers family inet-vpn unicast
set protocols bgp group parent-vpn-peers neighbor 192.0.2.5
set protocols bgp group parent-vpn-peers neighbor 192.0.2.12
set routing-instances coc-provider-vpn instance-type vrf
set routing-instances coc-provider-vpn interface ge-2/0/1.0
set routing-instances coc-provider-vpn route-distinguisher 192.0.2.7:1
set routing-instances coc-provider-vpn vrf-target target:300:1
set routing-instances coc-provider-vpn protocols bgp group toR7 family inet labeled-unicast per-prefix-label
set routing-instances coc-provider-vpn protocols bgp group toR7 type external
set routing-instances coc-provider-vpn protocols bgp group toR7 neighbor 10.1.0.26 peer-as 201
路由器 R7
set interfaces ge-2/0/0 unit 0 description toR6
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.26/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR8
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.29/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.8/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2054.00
set routing-options router-id 192.0.2.8
set routing-options autonomous-system 201
set protocols mpls traffic-engineering bgp-igp
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp egress-policy from-bgp
set protocols ldp interface ge-2/0/1.0
set protocols ldp interface lo0.0
set protocols ospf traffic-engineering
set protocols ospf export from-bgp
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/1.0 metric 10
set protocols bgp group toR6 type external
set protocols bgp group toR6 import send-all
set protocols bgp group toR6 family inet labeled-unicast
set protocols bgp group toR6 export send-all
set protocols bgp group toR6 neighbor 10.1.0.25 peer-as 300
set policy-options policy-statement from-bgp from protocol bgp
set policy-options policy-statement from-bgp then accept
set policy-options policy-statement send-all then accept
路由器 R8
set interfaces ge-2/0/0 unit 0 description toR7
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.30/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR9
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.33/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.9/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2053.00
set routing-options router-id 192.0.2.9
set routing-options autonomous-system 201
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp interface ge-2/0/0.0
set protocols ldp interface lo0.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/0.0 metric 10
set protocols bgp group toR1 local-address 192.0.2.9
set protocols bgp group toR1 type external
set protocols bgp group toR1 multihop ttl 10
set protocols bgp group toR1 family inet-vpn unicast
set protocols bgp group toR1 neighbor 192.0.2.2 peer-as 200
set policy-options policy-statement child_vpn_routes from protocol bgp
set policy-options policy-statement child_vpn_routes then accept
set routing-instances customer-provider-vpn instance-type vrf
set routing-instances customer-provider-vpn interface ge-2/0/1.0
set routing-instances customer-provider-vpn route-distinguisher 192.0.2.9:1
set routing-instances customer-provider-vpn vrf-target target:200:1
set routing-instances customer-provider-vpn protocols ospf export child_vpn_routes
set routing-instances customer-provider-vpn protocols ospf area 0.0.0.0 interface ge-2/0/1.0
路由器 R9
set interfaces ge-2/0/0 unit 0 description toR8
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.34/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.10/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2047.00
set routing-options router-id 192.0.2.10
set routing-options autonomous-system 101
set routing-options static route 198.51.100.1/24 discard
set protocols ospf export statics
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/0.0 metric 10
set policy-options policy-statement statics from route-filter 198.51.100.1/24 exact
set policy-options policy-statement statics then accept
路由器 R10
set interfaces ge-2/0/0 unit 0 description toR2
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.38/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR11
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.41/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.11.24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2061.00
set routing-options router-id 192.0.2.11
set routing-options autonomous-system 200
set protocols mpls traffic-engineering bgp-igp
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp egress-policy from-bgp
set protocols ldp interface ge-2/0/0.0
set protocols ldp interface lo0.0
set protocols ospf traffic-engineering
set protocols ospf export from-bgp
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-2/0/0.0 metric 10
set protocols bgp group toR4 type external
set protocols bgp group toR4 import send-local
set protocols bgp group toR4 family inet labeled-unicast
set protocols bgp group toR4 export send-local
set protocols bgp group toR4 neighbor 10.1.0.42 peer-as 300
set protocols bgp group toR4 inactive: neighbor 10.1.0.50 peer-as 300
set policy-options policy-statement from-bgp from protocol bgp
set policy-options policy-statement from-bgp then metric add 100
set policy-options policy-statement from-bgp then accept
set policy-options policy-statement send-local term 2 from metric 100
set policy-options policy-statement send-local term 2 then reject
set policy-options policy-statement send-local then accept
路由器 R11
set interfaces ge-2/0/0 unit 0 description toR10
set interfaces ge-2/0/0 unit 0 family inet address 10.1.0.42/30
set interfaces ge-2/0/0 unit 0 family iso
set interfaces ge-2/0/0 unit 0 family mpls
set interfaces ge-2/0/1 unit 0 description toR5
set interfaces ge-2/0/1 unit 0 family inet address 10.1.0.45/30
set interfaces ge-2/0/1 unit 0 family iso
set interfaces ge-2/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.0.2.12/24
set interfaces lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2062.00
set routing-options router-id 192.0.2.12
set routing-options autonomous-system 300
set protocols mpls interface all
set protocols ldp track-igp-metric
set protocols ldp interface ge-2/0/1.0
set protocols ldp interface lo0.0
set protocols isis level 1 disable
set protocols isis level 2 wide-metrics-only
set protocols isis interface ge-2/0/1.0 level 2 metric 10
set protocols isis interface lo0.0 passive
set protocols bgp group parent-vpn-peers type internal
set protocols bgp group parent-vpn-peers local-address 192.0.2.12
set protocols bgp group parent-vpn-peers family inet-vpn unicast
set protocols bgp group parent-vpn-peers neighbor 192.0.2.7
set protocols bgp group parent-vpn-peers neighbor 192.0.2.12
set routing-instances coc-provider-vpn instance-type vrf
set routing-instances coc-provider-vpn interface ge-2/0/0.0
set routing-instances coc-provider-vpn route-distinguisher 192.0.2.12:1
set routing-instances coc-provider-vpn vrf-target target:300:1
set routing-instances coc-provider-vpn protocols bgp group toR10 family inet labeled-unicast per-prefix-label
set routing-instances coc-provider-vpn protocols bgp group toR10 type external
set routing-instances coc-provider-vpn protocols bgp group toR10 neighbor 10.1.0.41 peer-as 200
在第 3 层 VPN 中配置提供商边缘链路保护
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置带标签的单播链路保护:
-
配置路由器接口。
[edit interfaces] user@R4# set ge-2/0/0 unit 0 description toR3 user@R4# set ge-2/0/0 unit 0 family inet address 10.1.0.14/30 user@R4# set ge-2/0/0 unit 0 family iso user@R4# set ge-2/0/0 unit 0 family mplsuser@R4# set ge-2/0/1 unit 0 description toR5 user@R4# set ge-2/0/1 unit 0 family inet address 10.1.0.17/30 user@R4# set ge-2/0/1 unit 0 family iso user@R4# set ge-2/0/1 unit 0 family mplsuser@R4# set lo0 unit 0 family inet address 192.0.2.5/24 user@R4# set lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2049.00同样地,在所有其他路由器上配置接口。
-
在 R4 上配置路由策略选项。
[edit policy-options] user@R4# set policy-statement 1b then load-balance per-packet同样,在此示例中,在路由器 R1、R3、R7、R8、R9 和 R10 上配置策略选项。
-
配置路由器 ID、自治系统 (AS) 编号和任何其他路由选项。
[edit routing-options] user@R4# set router-id 192.0.2.5 user@R4# set autonomous-system 300 user@R4# set forwarding-table export 1b同样,为所有其他路由器配置路由器 ID、AS 编号和任何其他路由选项。在此示例中,选择的路由器 ID 与路由器上配置的环路地址相同。
-
在路由器 R4 上配置 MPLS 和 LDP。
[edit protocols] user@R4# set mpls interface all user@R4# set ldp track-igp-metric user@R4# set ldp interface ge-2/0/1.0 user@R4# set ldp interface lo0.0同样,在除 R0 和 R9 之外的所有其他路由器上配置 MPLS 和 LDP。
-
在路由器 R4 面向核心的接口上配置 IGP。
[edit protocols isis] user@R4# set level 1 disable user@R4# set level 2 wide-metrics-only user@R4# set interface ge-2/0/1.0 level 2 metric 10 user@R4# set interface lo0.0 passive同样,配置其他路由器(此示例中为 R5、R6 和 R11 上的 IS-IS,以及所有其他路由器上的 OSPF)。
-
在路由器 R4 上配置 BGP。
[edit protocols bgp group parent-vpn-peers] user@R4# set type internal user@R4# set local-address 192.0.2.5 user@R4# set family inet-vpn unicast user@R4# set neighbor 192.0.2.7 user@R4# set neighbor 192.0.2.12同样,在路由器 R1、R3、R6、R7、R8、R10 和 R11 上配置 BGP。
-
在路由器 R4 上配置 VPN 路由和转发 (VRF) 实例,以创建第 3 层 VPN。
[edit routing-instances coc-provider-vpn] user@R4# set instance-type vrf user@R4# set interface ge-2/0/0.0 user@R4# set interface ge-2/0/2.0 user@R4# set route-distinguisher 192.0.2.5:1 user@R4# set vrf-target target:300:1[edit routing-instances coc-provider-vpn protocols bgp group toR3] user@R4# set type external user@R4# set family inet labeled-unicast per-prefix-label user@R4# set neighbor 10.1.0.13 peer-as 200同样,在 R1、R6、R8 和 R11 上配置其他 VRF 路由实例。
结果
在配置模式下,输入show interfaces、show protocolsshow policy-optionsshow routing-options和show routing-instances命令,以确认您的配置。
如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R4# show interfaces
ge-2/0/0 {
unit 0 {
description toR3;
family inet {
address 10.1.0.14/30;
}
family iso;
family mpls;
}
}
ge-2/0/1 {
unit 0 {
description toR5;
family inet {
address 10.1.0.17/30;
}
family iso;
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 192.0.2.5/24;
}
family iso {
address 47.0005.80ff.f800.0000.0108.0001.0102.5507.2049.00;
}
}
}
user@R4# show policy-options
policy-statement 1b {
then {
load-balance per-packet;
}
}
user@R4# show routing-options
router-id 192.0.2.5;
autonomous-system 300;
forwarding-table {
export 1b;
}
user@R4# show protocols
mpls {
interface all;
}
ldp {
track-igp-metric;
interface ge-2/0/1.0;
interface lo0.0;
}
isis {
level 1 disable;
level 2 wide-metrics-only;
interface ge-2/0/1.0 {
level 2 metric 10;
}
interface lo0.0 {
passive;
}
}
bgp {
group parent-vpn-peers {
type internal;
local-address 192.0.2.5;
family inet-vpn {
unicast;
}
neighbor 192.0.2.7;
neighbor 192.0.2.12;
}
}
user@R4# show routing-instances
coc-provider-vpn {
instance-type vrf;
interface ge-2/0/0.0;
interface ge-2/0/2.0;
route-distinguisher 192.0.2.5:1;
vrf-target target:300:1;
protocols {
bgp {
group toR3 {
type external;
family inet {
labeled-unicast {
per-prefix-label;
}
}
neighbor 10.1.0.13 {
peer-as 200;
}
}
}
}
}
如果完成路由器配置,请从配置模式输入 commit 。
在此示例中,对每台路由器重复该过程,并为每台路由器使用适当的接口名称和地址。
验证
确认配置工作正常。
启用保护
目的
在 R4 上启用保护以请求对从 R4 到 R3 的链路进行保护。
行动
-
protection在[edit routing-instances instance-name protocols bgp group group-name family inet labeled-unicast]层次结构级别添加语句。[edit routing-instances coc-provider-vpn protocols bgp group toR3] user@R4# set family inet labeled-unicast protection -
验证并提交配置。
type external; family inet { labeled-unicast { per-prefix-label; protection; } } neighbor 10.1.0.13 { peer-as 200; }
验证多路径条目
目的
验证 R4 是否具有包含两个条目的多路径条目。
行动
在路由器 R4 上的作模式下,运行 show route 192.0.2.2 命令检查到 R1 的路由。
user@R4> show route 192.0.2.2
#[Multipath/255] 00:02:44, metric 20
> to 10.1.0.13 via ge-2/0/0.0, Push 408592
to 10.1.0.18 via ge-2/0/1.0, Push 299856, Push 299792(top)
验证多路径条目是否具有不同的权重
目的
验证多路径条目中的两个路由是否具有不同的权重,第一个条目的权重为 0x1,第二个条目的权重为 0x4000。
行动
在路由器 R4 上的作模式下,运行 show route 192.0.2.2 detail 命令检查到 R1 的路由。
user@R4> show route 192.0.2.2 detail
#Multipath Preference: 255
Next hop type: List, Next hop index: 1048609
Address: 0x92f058c
Next-hop reference count: 4
Next hop: ELNH Address 0x92c48ac weight 0x1, selected
equal-external-internal-type external
Next hop type: Router, Next hop index: 1603
Address: 0x92c48ac
Next-hop reference count: 2
Next hop: 10.1.0.13 via ge-2/0/0.0
Label operation: Push 408592
Label TTL action: prop-ttl
Next hop: ELNH Address 0x92c548c weight 0x4000
equal-external-internal-type internal
Next hop type: Indirect
Address: 0x92c548c
Next-hop reference count: 3
Protocol next hop: 192.0.2.12
Push 299856
Indirect next hop: 0x9380f40 1048608 INH Session ID: 0x10001a
Next hop type: Router, Next hop index: 1586
Address: 0x92c5440
Next-hop reference count: 3
Next hop: 10.1.0.18 via ge-2/0/1.0
Label operation: Push 299856, Push 299792(top)
Label TTL action: prop-ttl, prop-ttl(top)
State: <ForwardingOnly Int Ext>
Inactive reason: Forwarding use only
Age: 3:38 Metric: 20
Validation State: unverified
Task: RT
Announcement bits (1): 0-KRT
AS path: 200 I
了解主机快速重新路由
主机快速重新路由 (HFRR) 将预先计算的保护路径添加到数据包转发引擎 (PFE) 中,这样,如果提供商边缘设备和服务器场之间的链路变得无法进行转发,PFE 可以使用其他路径,而无需等待路由器或协议提供更新的转发信息。这种预先计算的保护路径通常称为修复或备份路径。
HFRR 是一种保护多点接口(如以太网)上的 IP 端点的技术。对于服务器端点的快速服务恢复至关重要的数据中心,此技术非常重要。接口或链路出现故障后,HFRR 使本地修复时间约为 50 毫秒。
考虑 图 3 中所示的网络拓扑。
路由设备创建由地址解析协议 (ARP) 和 IPv6 邻接方发现协议 (NDP) 触发的主机路由转发条目。HFRR 通过路由协议提供的备份下一跃点来扩充主机路由。这些备份下一跳使到达的流量能够在网络重新融合时保持流动。
流量从连接到提供商边缘设备 PE1 和 PE2 的网络流向主机 A 和主机 B。此流量受 HFRR 保护。如果设备 PE2 与主机服务器之间的链路中断,流量将通过设备 PE1 重新路由到主机服务器。在拓扑中,主机 A 和主机 B 表示 LAN PC,统称为服务器场。PE 设备是在其之间配置了第 3 层 VPN 的路由器。设备 PE1 通过 ARP 或 IPv6 NDP 了解直接连接的主机。
设备 PE2 还包含有关服务器场网络的信息,并将此信息播发给设备 PE1。此播发使用内部 BGP (IBGP) 通过第 3 层 VPN 进行传输。在设备 PE1 和 PE2 上,此路由被视为到服务器场子网的直接路由。
设备 PE1 使用通过 ARP 和 NDP 获知的主机路由,将流量发送到服务器场中的主机。如果设备 PE1 与服务器场之间的链路中断且未配置 HFRR,路由设备将查找下一个最佳路由,即 IBGP 路由。此实施会导致流量在一段时间内丢失,直到更新发生且网络重新融合。设备 PE1 上配置的 HFRR 通过使用备份路径扩充 ARP 和 NDP 路由来解决此问题,这样流量就可以不间断地继续转发。
此特定拓扑中的备用路径是 IBGP 第 3 层 VPN 路由。在实际部署中,设备 PE2 还可以为其直接连接的服务器场网络配置链路保护,并且设备 PE1 可以使用设备 PE2 的第 3 层 VPN 路由通过自身向服务器场通告可访问性。因此,应在设备 PE1 和设备 PE2 上启用 HFRR。此外,设备 PE1 和设备 PE2 都应通过 BGP 播发对服务器场的可访问性。
例如,如果设备 PE1 到服务器场之间的链路以及设备 PE2 到服务器场之间的链路同时中断,则 PE 设备之间可能会形成临时路由环路。循环可以一直持续到两端的 BGP 获悉服务器场子网已关闭并撤回 BGP 路由。
ARP 前缀限制和停电补充超时
配置 HFRR 配置文件时,可选的 ARP 前缀限制会设置 ARP 路由的最大数量,从而为路由表中的每个 HFRR 配置文件创建的 FRR 路由数。此限制可防止 ARP 攻击耗尽路由设备上的虚拟内存。ARP 前缀限制不会限制转发表中的 ARP 路由。但是,它确实限制了 Junos OS 为配置文件读取的 ARP 路由数,从而限制了路由进程 (rpd) 在路由路由表和转发表中创建的 HFRR 路由数。
ARP 前缀限制将应用于每个 HFRR 配置文件。它不限制路由表中所有 ARP/HFRR 路由的总数。它仅限制每个 HFRR 配置文件的 ARP/HFRR 路由数。
有两个配置语句 ( global-arp-prefix-limit 和 arp-prefix-limit ) 用于设置 ARP 前缀限制,一个在全 [edit routing-options host-fast-reroute] 局层次结构级别,另一个 [edit routing-instances instance-name routing-options interface interface-name] 在层次结构级别。全局 global-arp-prefix-limit 语句为路由设备上配置的所有 HFRR 配置文件设置默认 ARP 前缀限制。该 arp-prefix-limit 语句将 global-arp-prefix-limit 覆盖该受保护接口的 for that HFRR 配置文件。
当 HFRR 配置文件中的 ARP 路由数达到配置的 ARP 前缀限制的 80% 时,将向系统日志发送警告消息。如果 ARP 前缀仍大于配置值的 80%,则对于添加到该 HFRR 配置文件的任何后续 ARP 路由,将显示警告消息。
当 HFRR 配置文件中的 ARP 路由数达到为 HFRR 配置文件配置的 ARP 前缀限制的 100% 时,将向系统日志发送另一条警告消息。当数字超过 100% 阈值时,HFRR 配置文件将被停用。发生这种情况时,所有 ARP/FRR 路由都将从路由表中删除。FRR 路由也会从转发表中删除。
停用 HFRR 配置文件后,将启动停电计时器。该计时器的超时值为 ARP 缓存超时(内核超时)+ 补充停电计时器。
有全局和每个 HFRR CLI 语句( global-supplementary-blackout-timer 和 supplementary-blackout-timer )。全局值位于 [edit routing-options host-fast-reroute] 层次结构级别,适用于路由设备上的所有 HFRR 配置文件。在 [edit routing-instances instance-name routing-options interface interface-name] 层次结构级别为路由实例接口配置的补充停电计时器仅覆盖该 HFRR 配置文件的全局值。
当停电计时器到期时,HFRR 配置文件将重新激活,并且 Junos OS 会重新学习 ARP 路由并重新创建 HFRR 路由。如果未再次超过 ARP 前缀限制,则 HFRR 路由将启动。
如果 HFRR 配置文件被列入黑名单并处于停用状态,则在每次提交作期间或每当使用 restart routing 命令重新启动路由进程 (rpd) 时,都会重新评估 ARP 状态。
主路由和备用路由候选项
HFRR 下一跃点的主要路由由 ARP 和 IPv6 NDP 路由提供。这些是 /32 或 /128 路由。备份路由与本地接口上配置的地址前缀完全匹配。例如,如果配置的本地地址为 10.0.0.5/24,路由设备将查找前缀 10.0.0.0、前缀长度为 24 的完全匹配项,以选择备份路由。
备份路由选择的约束如下:
-
必须是与路由设备支持 HFRR 的接口上配置的相同子网地址匹配的前缀。
-
远程端不得配置路由聚合(也称为汇总)。例如,如果远程端合并两个或多个 /24 子网来播发前缀长度小于 /24 的子网,则 Junos OS 不会选择此汇总路由作为备份路由。
-
如果另一个协议获知的路由表中存在另一个路由,且该路由的前缀最长匹配与 /32 或 /128(ARP 或 NDP)路由匹配,则不会将该路由选为备用路由。例如,假设本地接口地址为 10.0.0.5/24。此外,假设路由表包含前缀为 10.0.0.0/24 的 IBGP 路由和前缀为 10.0.0.0/28 的 OSPF 路由。尽管 /28 路由对于子网中的某些前缀来说是更好的路由,但 Junos OS 并未将 10.0.0.0/28 视为备用候选版本。IBGP 路由将成为所有主机路由的备用候选项。但是,在全局修复之后,OSPF 路由将用于转发。
简而言之,备用备用路由必须是与您使用 HFRR 保护的子网本地接口具有相同前缀的路由。
备份路径选择策略
备份选择仅考虑第 3 层 VPN 路由。HFRR 使用通常的 BGP 路径选择算法选择一条最佳备份路由。仅选择一个备份路径。如果存在多个备用路径候选路径,则选择算法会选择最佳备份路径。HFRR 在任何时间点仅提供两条路径,一条主路径和一条备份路径。如果所选备份路径本身包含两条路径,则该备份下一跃点中的第一条路径将用作 HFRR 路由的备份下一跃点。
主路径的安装权重为 1。备份路径的安装权重为 0x4000。备用路径显然必须是通过与主接口不同的接口的路径。
仅在接口所属的路由表中查找备份路由。对于 IPv4,Junos OS 使用 routing-instance-name.inet.0。对于 IPv6,Junos OS 采用 routing-instance-name.inet6.0 格式。
HFRR路由的特点
HFRR 路由是仅转发路由,不用于路由解析。HFRR 路由具有主机地址,这意味着它们的前缀长度为 /32 或 /128。对于具有双路由引擎的平台,备份路由进程 (rpd) 也会创建 HFRR 路由。但是,在路由引擎切换后备份成为主路由之前,备份郊出进程 (rpd) 不会将 HFRR 路由安装到路由表。
另请注意,如果路由表中存在 HFRR 路由,则该 HFRR 路由将用于单播反向路径转发 (uRPF) 计算。
移除 HFRR 路由
如果在配置中删除或停用了受保护的接口,在路由实例上配置了 HFRR 而路由实例已停用或删除,或者启用 HFRR ( link-protection (Host Fast Reroute) ) 的语句被删除或停用,则 HFRR 路由将被删除。当路由实例上发生灾难性作时(例如重新启动路由进程时),HFRR 路由将被删除并重新添加。如果删除了所有备份路由,则也会移除 HFRR 路由。例如,当 BGP 撤回路由时,或者当 BGP 被停用或删除时。
受保护的接口关闭后,如果 HFRR 被删除或停用,计时器将以 20 秒的超时开始。HFRR 路由删除会在计时器过期后发生。这是为了确保如果接口发生翻动(快速上升和下降),Junos OS 不会不必要地执行导致流量丢失的路由删除和添加。仅当接口关闭或者 HFRR 路由被删除或停用时,才使用此计时器。
在以下情况下,HFRR 路由将立即清除:
-
备份路由出现故障,并且没有其他可能的备份路径。
-
收到 ARP 删除消息。
-
路由进程 (rpd) 终止。
支持 HFRR 的接口
HFRR 仅在以太网接口上被允许。如果在点对点接口上配置 HFRR,则提交作将失败。
仅接受在 VPN 路由和转发 (VRF) 类型的路由实例下配置的接口。如果在其他类型的路由实例上配置 HFRR,则提交作将失败。
当不满足以下要求时,提交作不会失败。但是,该接口不受 HFRR 保护,并且该接口在命令输出中 show hfrr profiles 标记为非活动:
-
HFRR 只允许在带编号的接口上使用,这意味着必须为接口分配地址。例如,您不能在接口上配置有地址的 IPv4,而不能配置没有地址的 IPv6。
-
必须为
[edit interfaces]“HFRR 保护”配置在层次结构级别配置接口,并且还必须连接到路由实例。 -
路由实例必须具有虚拟隧道 (VT) 接口或
vrf-table-label包含语句。
接口可能在命令输出中被 show hfrr profiles 标记为非活动状态的另一个原因是,当接口从一个实例迁移到另一个实例时,并且 HFRR 配置位于之前的路由实例中。
如果重叠的逻辑单元属于同一个路由实例,则不支持 HFRR,如下所示:
user@host # show interfaces
ge-0/0/2 {
vlan-tagging;
unit 0 {
vlan-id 1;
family inet {
address 172.16.0.4/16; # same subnet
}
}
unit 1 {
vlan-id 2;
family inet {
address 172.16.0.5/16; # same subnet
}
}
}
如果按此处所示配置重叠子网,并在两个重叠子网上启用 HFRR,则路由协议进程 (rpd) 将生成RPD_ASSERT错误。
另见
示例:使用主机快速重新路由配置链路保护
此示例说明如何配置主机快速重新路由 (HFRR)。HFRR 保护多点接口(例如以太网)上的 IP 端点。
要求
此示例使用以下硬件和软件组件:
-
两台提供商边缘 (PE) 设备和四台提供商 (P) 设备。
-
该示例假定主机存在于 PE 设备后面。
-
该示例假定至少有一台第 3 层交换机(如 EX 系列交换机)连接到主机。
-
Junos OS 11.4R2 或更高版本。
概述
在此示例中,流量从连接到 PE 设备的网络流向服务器主机。此流量受 HFRR 保护。如果一个 PE 设备与服务器场之间的链路中断,流量将通过另一个 PE 设备重新路由到服务器场。
您可以通过将 link-protection 语句添加到路由实例的接口配置中来配置 HFRR。
[edit routing-instances cust1 routing-options]
set interface ge-4/1/0.0 link-protection (Host Fast Reroute)
建议在通过多点接口连接到服务器场的所有 PE 设备上包含此语句。
在此示例中,PE 设备通过第 3 层 VPN 路由和 BGP 通告其服务器场的可访问性。
作为可选设置,PE 设备配置了高可用性功能、不间断活动路由和虚拟路由器冗余协议 (VRRP)。不间断活动路由 (NSR) 使具有冗余路由引擎的路由平台能够从主路由路由引擎切换到备用路由引擎,而不会向对等节点发出发生更改的警报,也不会丢失路由和协议信息。VRRP 可以自动将可用路由器分配给参与的主机,从而提高路由路径的可用性和可靠性。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层 [edit] 级的 CLI 中。
设备 PE1
set interfaces ge-4/1/0 unit 0 family inet address 192.0.2.2/24
set interfaces ge-4/1/0 unit 0 description toPE2
set interfaces ge-0/2/0 unit 0 family inet address 10.10.10.1/30
set interfaces ge-0/2/0 unit 0 description toP1
set interfaces ge-0/2/0 unit 0 family mpls
set interfaces ge-0/2/4 unit 0 family inet address 10.10.15.2/30
set interfaces ge-0/2/4 unit 0 description toP5
set interfaces ge-0/2/4 unit 0 family mpls
set interfaces ge-4/1/0 unit 0 family inet address 192.0.2.2/24 vrrp-group 1 virtual-address 192.0.2.5
set interfaces ge-4/1/0 unit 0 family inet address 192.0.2.2/24 vrrp-group 1 priority 240
set interfaces ge-4/1/0 unit 0 family inet address 192.0.2.2/24 vrrp-group 1 fast-interval 100
set interfaces ge-4/1/0 unit 0 family inet address 192.0.2.2/24 vrrp-group 1 preempt
set interfaces ge-4/1/0 unit 0 family inet address 192.0.2.2/24 vrrp-group 1 accept-data
set interfaces lo0 unit 0 family inet address 10.255.8.207/32
set protocols mpls interface ge-0/2/0.0
set protocols mpls interface ge-0/2/4.0
set protocols bgp group pe-ce type internal
set protocols bgp group pe-ce local-address 10.255.8.207
set protocols bgp group pe-ce family inet-vpn unicast
set protocols bgp group pe-ce neighbor 10.255.8.86
set protocols bgp group pe-ce export send-routes
set protocols ospf area 0.0.0.0 interface ge-0/2/0.0
set protocols ospf area 0.0.0.0 interface ge-0/2/4.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ldp interface ge-0/2/0.0
set protocols ldp interface ge-0/2/4.0
set policy-options policy-statement send-routes term 1 from protocol direct
set policy-options policy-statement send-routes term 1 from protocol local
set policy-options policy-statement send-routes term 1 then accept
set routing-options nonstop-routing
set routing-options autonomous-system 100
set routing-instances cust1 instance-type vrf
set routing-instances cust1 interface ge-4/1/0.0
set routing-instances cust1 route-distinguisher 100:100
set routing-instances cust1 vrf-target target:100:100
set routing-instances cust1 vrf-table-label
set routing-instances cust1 routing-options interface ge-4/1/0.0 link-protection
设备 PE2
set interfaces ge-0/0/2 unit 0 family inet address 10.10.12.2/30
set interfaces ge-0/0/2 unit 0 description toP2
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces ge-0/1/2 unit 0 family inet address 10.10.13.1/30
set interfaces ge-0/1/2 unit 0 description toP4
set interfaces ge-0/1/2 unit 0 family mpls
set interfaces ge-2/0/2 unit 0 family inet address 192.0.2.3/24
set interfaces ge-2/0/2 unit 0 description toPE1
set interfaces ge-2/0/2 unit 0 family inet address 192.0.2.3/24 vrrp-group 1 virtual-address 192.0.2.5
set interfaces ge-2/0/2 unit 0 family inet address 192.0.2.3/24 vrrp-group 1 fast-interval 100
set interfaces ge-2/0/2 unit 0 family inet address 192.0.2.3/24 vrrp-group 1 preempt
set interfaces ge-2/0/2 unit 0 family inet address 192.0.2.3/24 vrrp-group 1 accept-data
set interfaces lo0 unit 0 family inet address 10.255.8.86/32
set protocols mpls interface ge-0/0/2.0
set protocols mpls interface ge-0/1/2.0
set protocols bgp group pe-ce type internal
set protocols bgp group pe-ce export send-routes
set protocols bgp group pe-ce local-address 10.255.8.86
set protocols bgp group pe-ce family inet-vpn unicast
set protocols bgp group pe-ce neighbor 10.255.8.207
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/1/2.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ldp interface ge-0/0/2.0
set protocols ldp interface ge-0/1/2.0
set policy-options policy-statement send-routes term 1 from protocol direct
set policy-options policy-statement send-routes term 1 from protocol local
set policy-options policy-statement send-routes term 1 then accept
set routing-options nonstop-routing
set routing-options autonomous-system 100
set routing-instances cust1 instance-type vrf
set routing-instances cust1 interface ge-2/0/2.0
set routing-instances cust1 route-distinguisher 100:100
set routing-instances cust1 vrf-target target:100:100
set routing-instances cust1 vrf-table-label
set routing-instances cust1 routing-options interface ge-2/0/2.0 link-protection
设备 P1
set interfaces ge-0/0/3 unit 0 family inet address 10.10.11.1/30
set interfaces ge-0/0/3 unit 0 description toP2
set interfaces ge-0/0/3 unit 0 family mpls
set interfaces ge-0/0/4 unit 0 family inet address 10.10.10.2/30
set interfaces ge-0/0/4 unit 0 description toPE1
set interfaces ge-0/0/4 unit 0 family mpls
set protocols mpls interface ge-0/0/4.0
set protocols mpls interface ge-0/0/3.0
set protocols ospf area 0.0.0.0 interface ge-0/0/4.0
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 passive
set protocols ldp interface ge-0/0/3.0
set protocols ldp interface ge-0/0/4.0
set routing-options autonomous-system 100
设备 P2
set interfaces ge-0/2/1 unit 0 family inet address 10.10.12.1/30
set interfaces ge-0/2/1 unit 0 description toPE2
set interfaces ge-0/2/1 unit 0 family mpls
set interfaces ge-1/2/1 unit 0 family inet address 10.10.11.2/30
set interfaces ge-1/2/1 unit 0 description toP1
set interfaces ge-1/2/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 10.255.8.246/32
set protocols mpls interface all
set protocols mpls interface fxp0.0 disable
set protocols ospf area 0.0.0.0 interface all
set protocols ospf area 0.0.0.0 interface fxp0.0 disable
set protocols ldp interface all
set protocols ldp interface fxp0.0 disable
set routing-options autonomous-system 100
设备 P4
set interfaces ge-0/2/3 unit 0 family inet address 10.10.13.2/30
set interfaces ge-0/2/3 unit 0 description toPE2
set interfaces ge-0/2/3 unit 0 family mpls
set interfaces ge-1/3/3 unit 0 family inet address 10.10.14.1/30
set interfaces ge-1/3/3 unit 0 description toP5
set interfaces ge-1/3/3 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 10.255.8.4/32
set protocols mpls interface ge-0/2/3.0
set protocols mpls interface ge-1/3/3.0
set protocols ospf area 0.0.0.0 interface ge-0/2/3.0
set protocols ospf area 0.0.0.0 interface ge-1/3/3.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ldp interface ge-0/2/3.0
set protocols ldp interface ge-1/3/3.0
set routing-options autonomous-system 100
设备 P5
set interfaces ge-0/1/2 unit 0 family inet address 10.10.15.1/30
set interfaces ge-0/1/2 unit 0 description toPE1
set interfaces ge-0/1/2 unit 0 family mpls
set interfaces ge-0/1/5 unit 0 family inet address 10.10.14.2/30
set interfaces ge-0/1/5 unit 0 description toP4
set interfaces ge-0/1/5 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 10.255.8.5/32
set protocols mpls interface ge-0/1/5.0
set protocols mpls interface ge-0/1/2.0
set protocols ospf area 0.0.0.0 interface ge-0/1/5.0
set protocols ospf area 0.0.0.0 interface ge-0/1/2.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ldp interface ge-0/1/2.0
set protocols ldp interface ge-0/1/5.0
set routing-options autonomous-system 100
程序
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置 HFRR,请执行以下作:
-
配置接口。
[edit interfaces] user@PE1# set ge-4/1/0 unit 0 family inet address 192.0.2.2/24 user@PE1# set ge-4/1/0 unit 0 description toPE2 user@PE1# set ge-0/2/0 unit 0 family inet address 10.10.10.1/30 user@PE1# set ge-0/2/0 unit 0 description toP1 user@PE1# set ge-0/2/0 unit 0 family mpls user@PE1# set ge-0/2/4 unit 0 family inet address 10.10.15.2/30 user@PE1# set ge-0/2/4 unit 0 description toP5 user@PE1# set ge-0/2/4 unit 0 family mpls user@PE1# set lo0 unit 0 family inet address 10.255.8.207/32 -
(选答)在设备 PE2 的接口上配置 VRRP。
[edit interfaces ge-4/1/0 unit 0 family inet address 192.0.2.2/24] user@PE1# set vrrp-group 1 virtual-address 192.0.2.5 user@PE1# set vrrp-group 1 priority 240 user@PE1# set vrrp-group 1 fast-interval 100 user@PE1# set vrrp-group 1 preempt user@PE1# set vrrp-group 1 accept-data -
在接口上配置 MPLS。
[edit protocols mpls] user@PE1# set interface ge-0/2/0.0 user@PE1# set interface ge-0/2/4.0 -
配置 BGP。
[edit protocols bgp group pe-ce] user@PE1# set type internal user@PE1# set local-address 10.255.8.207 user@PE1# set family inet-vpn unicast user@PE1# set neighbor 10.255.8.86 user@PE1# set export send-routes -
配置播发直接和本地接口路由的策略。
[edit policy-options policy-statement send-routes term 1] user@PE1# set from protocol direct user@PE1# set from protocol local user@PE1# set then accept -
配置内部网关协议,如 IS-IS 或 OSPF。
[edit protocols ospf area 0.0.0.0] user@PE1# set interface ge-0/2/0.0 user@PE1# set interface ge-0/2/4.0 user@PE1# set interface lo0.0 passive -
配置信令协议,如 RSVP 或 LDP。
[edit protocols ldp] user@PE1# set interface ge-0/2/0.0 user@PE1# set interface ge-0/2/4.0 -
(选答)配置不间断活动路由。
[edit routing-options] user@PE1# set nonstop-routing -
配置自治系统 (AS)。
[edit routing-options] user@PE1# set routing-options autonomous-system 100 -
配置第 3 层 VPN 路由实例。
[edit routing-instances cust1] user@PE1# set instance-type vrf user@PE1# set interface ge-4/1/0.0 user@PE1# set route-distinguisher 100:100 user@PE1# set vrf-target target:100:100 user@PE1# set vrf-table-label -
配置 HFRR 链路保护。
[edit routing-instances cust1 routing-options] user@PE1# set interface ge-4/1/0.0 link-protection (Host Fast Reroute) -
如果完成设备配置,请提交配置。
[edit] user@PE1# commit
结果
通过发出show interfaces、show protocols、show policy-optionsshow routing-options、和show routing-instances命令来确认您的配置。
user@PE1# show interfaces
ge-4/1/0 {
unit 0 {
description toPE2;
family inet {
address 192.0.2.2/24 {
vrrp-group 1 {
virtual-address 192.0.2.5;
priority 240;
fast-interval 100;
preempt;
accept-data;
}
}
}
}
}
ge-0/2/0 {
unit 0 {
description toP1;
family inet {
address 10.10.10.1/30;
}
family mpls;
}
}
ge-0/2/4 {
unit 0 {
description toP5;
family inet {
address 10.10.15.2/30;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.255.8.207/32;
}
}
}
user@PE1# show protocols
mpls {
interface ge-0/2/0.0;
interface ge-0/2/4.0;
}
bgp {
group pe-ce {
export-send-routes;
type internal;
local-address 10.255.8.207;
family inet-vpn {
unicast;
}
neighbor 10.255.8.86;
}
}
ospf {
area 0.0.0.0 {
interface ge-0/2/0.0;
interface ge-0/2/4.0;
interface lo0.0 {
passive;
}
}
}
ldp {
interface ge-0/2/0.0;
interface ge-0/2/4.0;
}
user@PE1# show policy-options
policy-statement send-routes {
term 1 {
from protocol [ direct local ];
then accept;
}
}
user@PE1# show routing-options nonstop-routing; autonomous-system 100;
user@PE1# show routing-instances
cust1 {
instance-type vrf;
interface ge-4/1/0.0;
route-distinguisher 100:100;
vrf-target target:100:100;
vrf-table-label;
routing-options {
interface {
ge-4/1/0.0 {
link-protection;
}
}
}
}
验证
确认配置工作正常。
验证 HFRR
目的
确保 HFRR 已启用。
行动
user@PE1> show hfrr profiles HFRR pointer: 0x9250000 HFRR Current State: HFRR_ACTIVE HFRR Protected IFL Name: ge-4/1/0.0 HFRR Protected IFL Handle: 0x921086c HFRR Routing Instance Name: cust1 HFRR Routing Instance Handle: 0x9129740 HFRR Sync BG Sceduled: NO HFRR RTS Filter On: YES HFRR Delete BG Scheduled: NO HFRR Num ARP Routes learnt: 100 HFRR Num FRR Routes Created: 100
意义
输出显示 HFRR 已在接口 ge-4/1/0.0 上启用。
验证 ARP 路由
目的
确保学习了预期的 ARP 路由。
行动
user@PE1> show route protocol arp
inet.0: 43 destinations, 43 routes (42 active, 0 holddown, 1 hidden)
inet.3: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
cust1.inet.0: 1033 destinations, 2043 routes (1033 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.0.2.3/24 @[ARP/4294967293] 00:04:35, from 192.0.2.1
Unusable
192.0.2.4/24 @[ARP/4294967293] 00:04:35, from 192.0.2.1
Unusable
192.0.2.5/24 @[ARP/4294967293] 00:04:32, from 192.0.2.1
Unusable
192.0.2.6/24 @[ARP/4294967293] 00:04:34, from 192.0.2.1
Unusable
192.0.2.7/24 @[ARP/4294967293] 00:04:35, from 192.0.2.1
Unusable
192.0.2.8/24 @[ARP/4294967293] 00:04:35, from 192.0.2.1
Unusable
192.0.2.9/24 @[ARP/4294967293] 00:04:35, from 192.0.2.1
Unusable
192.0.2.10/24 @[ARP/4294967293] 00:04:35, from 192.0.2.1
Unusable
192.0.2.11/24 @[ARP/4294967293] 00:04:33, from 192.0.2.1
Unusable
192.0.2.12/24 @[ARP/4294967293] 00:04:33, from 192.0.2.1
Unusable
192.0.2.13/24 @[ARP/4294967293] 00:04:33, from 192.0.2.1
Unusable
...
验证快速重新路由路由
目的
确保学习预期的快速重新路由 (FRR) 路由。
行动
user@PE1> show route protocol frr
inet.0: 43 destinations, 43 routes (42 active, 0 holddown, 1 hidden)
inet.3: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
cust1.inet.0: 1033 destinations, 2043 routes (1033 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.0.2.3/24 #[FRR/200] 00:05:38, from 192.0.2.1
> to 192.0.2.3 via ge-4/1/0.0
to 10.10.15.1 via ge-0/2/4.0, Push 16, Push 299792(top)
192.0.2.4/24 #[FRR/200] 00:05:38, from 192.0.2.1
> to 192.0.2.4 via ge-4/1/0.0
to 10.10.15.1 via ge-0/2/4.0, Push 16, Push 299792(top)
192.0.2.5/24 #[FRR/200] 00:05:35, from 192.0.2.1
> to 192.0.2.5 via ge-4/1/0.0
to 10.10.15.1 via ge-0/2/4.0, Push 16, Push 299792(top)
192.0.2.6/24 #[FRR/200] 00:05:37, from 192.0.2.1
> to 192.0.2.6 via ge-4/1/0.0
to 10.10.15.1 via ge-0/2/4.0, Push 16, Push 299792(top)
192.0.2.7/24 #[FRR/200] 00:05:38, from 192.0.2.1
> to 192.0.2.7 via ge-4/1/0.0
to 10.10.15.1 via ge-0/2/4.0, Push 16, Push 299792(top)
192.0.2.8/24 #[FRR/200] 00:05:38, from 192.0.2.1
> to 192.0.2.8 via ge-4/1/0.0
to 10.10.15.1 via ge-0/2/4.0, Push 16, Push 299792(top)
192.0.2.9/24 #[FRR/200] 00:05:38, from 192.0.2.1
> to 192.0.2.9 via ge-4/1/0.0
to 10.10.15.1 via ge-0/2/4.0, Push 16, Push 299792(top)
192.0.2.10/24 #[FRR/200] 00:05:38, from 192.0.2.1
...
验证转发
目的
请确保预期路由显示在转转发表中。
行动
user@PE1> show route forwarding-table destination 192.0.2.3
Routing table: default.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 rjct 36 1
Routing table: default-switch.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 rjct 554 1
Routing table: __master.anon__.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 rjct 532 1
Routing table: cust1.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
192.0.2.3/24 user 0 ulst 1048575 2
0:0:14:14:1:3 ucst 767 3 ge-4/1/0.0
indr 1048574 1001
10.10.15.1 Push 16, Push 299792(top) 1262 2 ge-0/2/4.0
192.0.2.3/24 dest 0 0:0:14:14:1:3 ucst 767 3 ge-4/1/0.0
...
