BGP 会话和路由翻动
了解 BGP 会话重置
某些配置操作和事件会导致 BGP 会话被重置(丢弃,然后重新建立)。
如果在同一路由设备上同时配置路由反射和 VPN,则对路由反射配置的以下修改会导致当前 BGP 会话被重置:
添加群集 ID — 如果 BGP 会话与添加群集 ID 的组共享相同的自治系统 (AS) 编号,则无论 BGP 会话是否包含在同一组中,所有 BGP 会话都会重置。
创建新的路由反射器 — 如果具有具有 AS 编号的内部 BGP (IBGP) 组,并创建新的路由反射器组与相同的 AS 编号,则 IBGP 组和新路由反射器组中的所有 BGP 会话都将重置。
更改影响 BGP 对等方(如重命名 BGP 组)的配置语句将重置 BGP 会话。
如果更改在层次结构级别指定的
[edit protocols bgp family]
地址族,则路由设备上的当前所有 BGP 会话都会被丢弃,然后重新建立。
示例:防止在配置 VPN 系列时 BGP 会话翻动
此示例显示了一个已知问题的解决方法,即在配置虚拟专用网络 (VPN) 系列时,BGP 会话有时会关闭,然后重新出现(换句话说,翻动)。如果在 BGP 主实例上配置了任何 VPN 系列(例如、inet-vpn
、inet6-vpn
inet-mpvn
、l2vpn
inet-mdt
inet6-mpvn
iso-vpn
等),则路由反射器 (RR) 内部 BGP (IBGP) 会话或外部 BGP (EBGP) 会话的翻动会导致配置同一 VPN 系列的其他 BGP 会话翻动。
要求
开始之前:
配置路由器接口。
配置内部网关协议 (IGP)。
配置 BGP。
配置 VPN。
概述
将路由器或交换机配置为路由反射器 (RR) 或 AS 边界路由器(外部 BGP 对等方)并配置了 VPN 系列(例如 family inet-vpn unicast
语句)时,RR IBGP 会话或 EBGP 会话的翻动会导致使用语句 family inet-vpn unicast
配置的所有其他 BGP 会话翻动。此示例说明如何防止这些不必要的会话翻动。
发生翻动行为的原因与始发 VPN 路由时 Junos OS 中的 BGP 操作有关。
BGP 在始发 VPN 路由方面具有以下两种操作模式:
如果 BGP 由于会话没有 EBGP 对等方和 RR 客户端而不需要传播 VPN 路由,BGP 会将 VPN 路由从 instance.inet.0 路由表直接导出到其他 PE 路由器。此行为十分有效,因为它可避免创建多个路由的两个副本(一个在 instance.inet.0 表中,一个在 bgp.l3vpn.0 表中)。
如果 BGP 确实需要传播 VPN 路由,因为会话有 EBGP 对等方或 RR 客户端,BGP 首先将 VPN 路由从 instance.inet.0 表导出到 bgp.l3vpn.0 表。然后 BGP 将路由导出到其他 PE 路由器。在这种情况下,需要路由的两个副本才能启用最佳路由选择。PE 路由器可能从 CE 设备以及 RR 客户端或 EBGP 对等方接收相同的 VPN 路由。
如果 .inet.0 中的 instance路由是辅助路由,则不执行路由导出。在 Junos OS 中,路由只作为主路由导出一次,从一个路由表导出到另一个路由表作为辅助路由。由于 .inet.0 中的 instance路由已经是辅助路由,因此不允许根据需要再次移动到 bgp.l3vpn.0 表。路由不会到达 bgp.l3vpn.0 表,因此不会播发。一种解决方法是发送应该播发到 inet.0 的路由,以便播发这些路由。
当由于配置更改,BGP 从需要路由的两个副本转变为不需要路由的两个副本(反之亦然),通过交换 VPN 路由的所有会话都会关闭,然后重新连接。虽然此示例重点介绍了语句 family inet-vpn unicast
,但此概念适用于所有 VPN 网络层可访问性信息 (NLRI) 系列。这个问题也会影响逻辑系统。与 VPN NLRI 系列相关的主实例中的所有 BGP 会话将被关闭,以便为 VPN NLRI 系列实施表播发更改。将 RR 更改为非 RR 或反向(通过添加或删除 cluster
语句)将导致表播发发生变化。此外,为 VPN NLRI 系列配置第一个 EBGP 会话或从主实例中的配置中移除 EBGP 会话将导致表播发发生变化。
防止这些不必要的会话翻动的方法是将额外的 RR 客户端或 EBGP 会话配置为具有不存在的邻接地址的被动会话。此示例重点介绍 EBGP 案例,但同样的解决方法适用于 RR 案例。
当会话为被动时,路由设备不会向对等方发送 Open 请求。将路由设备配置为被动路由设备后,路由设备不会发起 TCP 连接。但是,当路由设备收到来自对等方的连接和 Open 消息时,它会使用另一条 BGP Open 消息进行回复。每个路由设备都会声明自己的功能。
拓扑
图 1 显示了 EBGP 案例的拓扑。路由器 R1 具有与路由器 R2 和 R3 的 IBGP 会话,以及具有路由器 R4 的 EBGP 会话。所有会话均配置了语句 family inet-vpn unicast
。如果 R1-R4 EBGP 会话翻动,R1-R2 和 R1-R3 BGP 会话也会翻动。

图 2 显示了 RR 案例的拓扑。路由器 R1 是 RR,路由器 R3 是客户端。路由器 R1 具有与路由器 R2 和 R3 的 IBGP 会话。所有会话均配置了语句 family inet-vpn unicast
。如果 R1-R3 会话翻动,R1-R2 和 R1-R4 会话也会翻动。

配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
。
set protocols bgp family inet-vpn unicast set protocols bgp family l2vpn signaling set protocols bgp group R1-R4 type external set protocols bgp group R1-R4 local-address 4.4.4.2 set protocols bgp group R1-R4 neighbor 4.4.4.1 peer-as 200 set protocols bgp group R1-R2-R3 type internal set protocols bgp group R1-R2-R3 log-updown set protocols bgp group R1-R2-R3 local-address 15.15.15.15 set protocols bgp group R1-R2-R3 neighbor 12.12.12.12 set protocols bgp group R1-R2-R3 neighbor 13.13.13.13 set protocols bgp group Fake type external set protocols bgp group Fake passive set protocols bgp group Fake neighbor 100.100.100.100 peer-as 500
程序
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置 EBGP 方案,
配置一个或多个 VPN 系列。
[edit protocols bgp] user@R1# set family inet-vpn unicast user@R1# set family l2vpn signaling
配置 EBGP 会话。
[edit protocols bgp] user@R1# set group R1-R4 type external user@R1# set group R1-R4 local-address 4.4.4.2 user@R1# set group R1-R4 neighbor 4.4.4.1 peer-as 200
配置 IBGP 会话。
[edit protocols bgp] user@R1# set group R1-R2-R3 type internal user@R1# set group R1-R2-R3 local-address 15.15.15.15 user@R1# set group R1-R2-R3 neighbor 12.12.12.12 user@R1# set group R1-R2-R3 neighbor 13.13.13.13
(可选)配置 BGP,以便在 BGP 对等方进行状态转换时生成
syslog
消息。[edit protocols bgp] user@R1# set group R1-R2-R3 log-updown
启用语句
log-updown
会导致在warning
级别记录 BGP 状态转换。
程序
逐步过程
要验证是否发生了不必要的会话抖动:
运行
show bgp summary
命令以验证会话是否已建立。user@R1> show bgp summary Groups: 2 Peers: 3 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 0 0 0 0 0 0 bgp.l2vpn.0 0 0 0 0 0 0 inet.0 0 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 4.4.4.1 200 6 5 0 0 1:08 Establ bgp.l3vpn.0: 0/0/0/0 bgp.l2vpn.0: 0/0/0/0 12.12.12.12 100 3 7 0 0 1:18 Establ bgp.l3vpn.0: 0/0/0/0 bgp.l2vpn.0: 0/0/0/0 13.13.13.13 100 3 6 0 0 1:14 Establ bgp.l3vpn.0: 0/0/0/0 bgp.l2vpn.0: 0/0/0/0
停用 EBGP 会话。
user@R1# deactivate group R1-R4 user@R1# commit
Mar 10 18:27:40 R1: rpd[1464]: bgp_peer_delete:6589: NOTIFICATION sent to 4.4.4.1 (External AS 200): code 6 (Cease) subcode 3 (Peer Unconfigured), Reason: Peer Deletion Mar 10 18:27:40 R1: rpd[1464]: bgp_adv_main_update:7253: NOTIFICATION sent to 12.12.12.12 (Internal AS 100): code 6 (Cease) subcode 6 (Other Configuration Change), Reason: Configuration change - VPN table advertise Mar 10 18:27:40 R1: rpd[1464]: bgp_adv_main_update:7253: NOTIFICATION sent to 13.13.13.13 (Internal AS 100): code 6 (Cease) subcode 6 (Other Configuration Change), Reason: Configuration change - VPN table advertise
运行
show bgp summary
命令以查看会话抖动。user@R1> show bgp summary Groups: 1 Peers: 2 Down peers: 2 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 0 0 0 0 0 0 bgp.l2vpn.0 0 0 0 0 0 0 inet.0 0 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 12.12.12.12 100 4 9 0 1 19 Active 13.13.13.13 100 4 8 0 1 19 Active
user@R1> show bgp summary Groups: 1 Peers: 2 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 0 0 0 0 0 0 bgp.l2vpn.0 0 0 0 0 0 0 inet.0 0 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 12.12.12.12 100 2 3 0 1 0 Establ bgp.l3vpn.0: 0/0/0/0 bgp.l2vpn.0: 0/0/0/0 13.13.13.13 100 2 3 0 1 0 Establ bgp.l3vpn.0: 0/0/0/0 bgp.l2vpn.0: 0/0/0/0
程序
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
为防止不必要的 BGP 会话翻动:
使用对等自治系统 (AS) 中不存在的邻接方地址添加被动 EBGP 会话。
[edit protocols bgp] user@R1# set group Fake type external user@R1# set group Fake passive user@R1# set neighbor 100.100.100.100 peer-as 500
show bgp summary
运行命令以验证是否已建立真正的会话,以及被动会话是否空闲。user@R1> show bgp summary Groups: 3 Peers: 4 Down peers: 1 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 0 0 0 0 0 0 bgp.l2vpn.0 0 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 4.4.4.1 200 9500 9439 0 0 2d 23:14:23 Establ bgp.l3vpn.0: 0/0/0/0 bgp.l2vpn.0: 0/0/0/0 12.12.12.12 100 10309 10239 0 0 3d 5:17:49 Establ bgp.l3vpn.0: 0/0/0/0 13.13.13.13 100 10306 10241 0 0 3d 5:18:25 Establ bgp.l3vpn.0: 0/0/0/0 100.100.100.100 500 0 0 0 0 2d 23:38:52 Idle
验证
确认配置工作正常。
验证 IBGP 会话是否保持正常运行
目的
请确保 IBGP 会话在 EBGP 会话停用后不会翻动。
行动
user@R1> show bgp summary Groups: 2 Peers: 3 Down peers: 1 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 0 0 0 0 0 0 bgp.l2vpn.0 0 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 12.12.12.12 100 10312 10242 0 0 3d 5:19:01 Establ bgp.l3vpn.0: 0/0/0/0 13.13.13.13 100 10309 10244 0 0 3d 5:19:37 Establ bgp.l3vpn.0: 0/0/0/0 100.100.100.100 500 0 0 0 0 2d 23:40:04 Idle
user@R1> show bgp summary Groups: 3 Peers: 4 Down peers: 1 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 0 0 0 0 0 0 bgp.l2vpn.0 0 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 4.4.4.1 200 5 4 0 0 28 Establ bgp.l3vpn.0: 0/0/0/0 bgp.l2vpn.0: 0/0/0/0 12.12.12.12 100 10314 10244 0 0 3d 5:19:55 Establ bgp.l3vpn.0: 0/0/0/0 13.13.13.13 100 10311 10246 0 0 3d 5:20:31 Establ bgp.l3vpn.0: 0/0/0/0 100.100.100.100 500 0 0 0 0 2d 23:40:58 Idle
了解衰减参数
BGP 路由翻动 描述了 BGP 系统发送过多的更新消息来播发网络可访问性信息的情况。BGP 抖动抑制 是一种减少 BGP 对等方之间发送的更新消息数的方法,从而减少这些对等方上的负载,而不会对稳定路由的路由融合时间产生不利影响。
抖动通过将路由标记为没有资格选择为活动或首选路由来减少更新消息的数量。这样标记路由会导致一些延迟,或者 suppression说路由信息的传播有一定延迟,但结果是网络稳定性得到提高。通常,对外部 BGP (EBGP) 路由(不同 AS 中的路由)应用抖动抑制。您还可以在联盟内,在联盟成员 AS 之间应用翻动衰减。由于 AS 中的路由一致性很重要,因此不要对内部 BGP (IBGP) 路由应用抖动抑制。(如果这样做,将忽略它。)
该规则有一个例外。从 Junos OS 12.2 版开始,您可以在地址族级别应用抖动抑制。在 Junos OS 12.2 或更高版本的安装中,当您在地址家族级别应用翻动抑制时,它同时适用于 IBGP 和 EBGP。
默认情况下,未启用路由翻动抑制。抑制应用于外部对等方和联合边界上的对等方。
启用衰减时,将应用默认参数,汇总见 表 1。
衰减参数 |
说明 |
默认值 |
可能的值 |
---|---|---|---|
half-life minutes |
衰减半衰期 — 几分钟后,如果路由保持稳定,任意值将减半。 |
15(分钟) |
1 通过 45 |
max-suppress minutes |
路由的最大暂侯时间(几分钟)。 |
60 (分钟) |
1 通过 720 |
reuse |
重用阈值 — 低于该阈值的任意值可再次使用抑制的路由。 |
750 |
1 通过 20,000 |
suppress |
截止(抑制)阈值 — 路由不能再使用或包含在播发中的任意值。 |
3000 |
1 通过 20,000 |
要更改默认的 BGP 抖动抑制值,请通过创建一组命名的抑制参数并将其包含到带有抑制操作的路由策略中来定义操作。要使抑制路由策略起作用,还必须启用 BGP 路由抖动抑制。
另请参阅
示例:配置 BGP 路由抖动抑制参数
此示例说明如何配置衰减参数。
要求
开始之前,请配置路由器接口并配置路由协议。
概述
此示例具有三个路由设备。设备 R2 具有与设备 R1 和设备 R3 的外部 BGP (EBGP) 连接。
设备 R1 和设备 R3 配置了一些用于测试的静态路由,这些静态路由通过 BGP 播发至设备 R2。
设备 R2 会根据以下标准抑制从设备 R1 和设备 R3 接收的路由:
抑制掩码长度等于或大于 17 的所有前缀,比掩码长度在 9 到 16 之间的路由要积极。
掩码长度在 0 到 8(含)之间的衰减路由,小于掩码长度大于 8 的路由。
完全不损害 10.128.0.0/9 前缀。
当路由从路由表导出到转发表时,将评估路由策略。只有活动路由从路由表导出。
图 3 显示了示例网络。

#d179e75__d179e261本节介绍设备 R2 上的步骤。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
。
设备 R1
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.1/30 set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set protocols bgp group ext type external set protocols bgp group ext export send-direct-and-static set protocols bgp group ext peer-as 200 set protocols bgp group ext neighbor 10.0.0.2 set policy-options policy-statement send-direct-and-static term 1 from protocol direct set policy-options policy-statement send-direct-and-static term 1 from protocol static set policy-options policy-statement send-direct-and-static term 1 then accept set routing-options static route 172.16.0.0/16 reject set routing-options static route 172.16.128.0/17 reject set routing-options static route 172.16.192.0/20 reject set routing-options static route 10.0.0.0/9 reject set routing-options static route 172.16.233.0/7 reject set routing-options static route 10.224.0.0/11 reject set routing-options static route 0.0.0.0/0 reject set routing-options autonomous-system 100
设备 R2
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.2/30 set interfaces fe-1/2/1 unit 0 family inet address 10.1.0.1/30 set interfaces lo0 unit 0 family inet address 192.168.0.2/32 set protocols bgp damping set protocols bgp group ext type external set protocols bgp group ext import damp set protocols bgp group ext export send-direct set protocols bgp group ext neighbor 10.0.0.1 peer-as 100 set protocols bgp group ext neighbor 10.1.0.2 peer-as 300 set policy-options policy-statement damp term 1 from route-filter 10.128.0.0/9 exact damping dry set policy-options policy-statement damp term 1 from route-filter 0.0.0.0/0 prefix-length-range /0-/8 damping timid set policy-options policy-statement damp term 1 from route-filter 0.0.0.0/0 prefix-length-range /17-/32 damping aggressive set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 then accept set policy-options damping aggressive half-life 30 set policy-options damping aggressive suppress 2500 set policy-options damping timid half-life 5 set policy-options damping dry disable set routing-options autonomous-system 200
设备 R3
set interfaces fe-1/2/1 unit 0 family inet address 10.1.0.2/30 set interfaces lo0 unit 0 family inet address 192.168.0.3/32 set protocols bgp group ext type external set protocols bgp group ext export send-direct-and-static set protocols bgp group ext peer-as 200 set protocols bgp group ext neighbor 10.1.0.1 set policy-options policy-statement send-direct-and-static term 1 from protocol direct set policy-options policy-statement send-direct-and-static term 1 from protocol static set policy-options policy-statement send-direct-and-static term 1 then accept set routing-options static route 10.128.0.0/9 reject set routing-options autonomous-system 300
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置衰减参数:
配置接口。
[edit interfaces] user@R2# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30 user@R2# set fe-1/2/1 unit 0 family inet address 10.1.0.1/30 user@R2# set lo0 unit 0 family inet address 192.168.0.2/32
配置 BGP 邻接方。
[edit protocols bgp group ext] user@R2# set type external user@R2# set neighbor 10.0.0.1 peer-as 100 user@R2# set neighbor 10.1.0.2 peer-as 300
创建和配置衰减参数组。
[edit policy-options] user@R2# set damping aggressive half-life 30 user@R2# set damping aggressive suppress 2500 user@R2# set damping timid half-life 5 user@R2# set damping dry disable
配置抑制策略。
[edit policy-options policy-statement damp term 1] user@R2# set from route-filter 10.128.0.0/9 exact damping dry user@R2# set from route-filter 0.0.0.0/0 prefix-length-range /0-/8 damping timid user@R2# set from route-filter 0.0.0.0/0 prefix-length-range /17-/32 damping aggressive
为 BGP 启用抑制。
[edit protocols bgp] user@R2# set damping
将策略应用为 BGP 邻接方的导入策略。
[edit protocols bgp group ext] user@R2# set import damp
注:您可以在相同或不同的
import
语句中多次引用相同的路由策略。配置导出策略。
[edit policy-options policy-statement send-direct term 1] user@R2# set from protocol direct user@R2# set then accept
应用导出策略。
[edit protocols bgp group ext] user@R2# set export send-direct
配置自治系统 (AS) 编号。
[edit routing-options] user@R2# set autonomous-system 200
结果
在配置模式下,通过发出 show interfaces
、 show protocols
、 show policy-options
和 show routing-options
命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R2# show interfaces fe-1/2/0 { unit 0 { family inet { address 10.0.0.2/30; } } } fe-1/2/1 { unit 0 { family inet { address 10.1.0.1/30; } } } lo0 { unit 0 { family inet { address 192.168.0.2/32; } } }
user@R2# show protocols bgp { damping; group ext { type external; import damp; export send-direct; neighbor 10.0.0.1 { peer-as 100; } neighbor 10.1.0.2 { peer-as 300; } } }
user@R2# show policy-options policy-statement damp { term 1 { from { route-filter 10.128.0.0/9 exact damping dry; route-filter 0.0.0.0/0 prefix-length-range /0-/8 damping timid; route-filter 0.0.0.0/0 prefix-length-range /17-/32 damping aggressive; } } } policy-statement send-direct { term 1 { from protocol direct; then accept; } } damping aggressive { half-life 30; suppress 2500; } damping timid { half-life 5; } damping dry { disable; }
user@R2# show routing-options autonomous-system 200;
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
导致某些路由翻动
目的
要验证路由翻动抑制策略,某些路由必须翻动。拥有实时互联网源几乎可以保证出现一定数量的路由翻动。如果您能够控制正在播发路由的远程系统,则可以修改播发路由器的策略,以播发和撤销所有路由或给定前缀。在测试环境中,可以通过清除 BGP 邻接方或重新启动 BGP 邻接方上的路由进程来导致路由翻动,如下所示。
行动
在设备 R1 和设备 R3 的操作模式下,输入 restart routing
命令。
在生产网络中谨慎使用此命令。
user@R1> restart routing R1 started, pid 10474
user@R3> restart routing R3 started, pid 10478
含义
在设备 R2 上,来自邻接方的所有路由都会被撤销并重新播发。
检查路由翻动
目的
查看邻接方翻动的数量。
行动
在操作模式下,输入 show bgp summary
命令。
user@R2> show bgp summary Groups: 1 Peers: 2 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 12 1 11 0 11 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 10.0.0.1 100 10 10 0 4 2:50 0/9/0/9 0/0/0/0 10.1.0.2 300 10 10 0 4 2:53 1/3/1/2 0/0/0/0
含义
此输出是在设备 R2 邻接方上四次重新启动路由进程后捕获的。
验证路由抖动抑制
目的
验证路由是否由于受阻而被隐藏。
行动
在操作模式下,输入 show route damping suppressed
命令。
user@R2> show route damping suppressed inet.0: 15 destinations, 17 routes (6 active, 0 holddown, 11 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 10.0.0.0/9 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 10.0.0.0/30 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 10.1.0.0/30 [BGP ] 00:00:15, localpref 100 AS path: 300 I, validation-state: unverified > to 10.1.0.2 via fe-1/2/1.0 10.224.0.0/11 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 172.16.0.0/16 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 172.16.128.0/17 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 172.16.192.0/20 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 192.168.0.1/32 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 192.168.0.3/32 [BGP ] 00:00:15, localpref 100 AS path: 300 I, validation-state: unverified > to 10.1.0.2 via fe-1/2/1.0 172.16.233.0/7 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0
含义
输出显示路由不稳定。11 个路由因受阻而被隐藏。
显示受阻路由的详细信息
目的
显示受阻路由的详细信息。
行动
在操作模式下,输入 show route damping suppressed 172.16.192.0/20 detail
命令。
user@R2> show route damping suppressed 172.16.192.0/20 detail inet.0: 15 destinations, 17 routes (6 active, 0 holddown, 11 hidden) 172.16.192.0/20 (1 entry, 0 announced) BGP /-101 Next hop type: Router, Next hop index: 758 Address: 0x9414484 Next-hop reference count: 9 Source: 10.0.0.1 Next hop: 10.0.0.1 via fe-1/2/0.0, selected Session Id: 0x100201 State: <Hidden Ext> Local AS: 200 Peer AS: 100 Age: 52 Validation State: unverified Task: BGP_100.10.0.0.1+55922 AS path: 100 I Localpref: 100 Router ID: 192.168.0.1 Merit (last update/now): 4278/4196 damping-parameters: aggressive Last update: 00:00:52 First update: 01:01:55 Flaps: 8 Suppressed. Reusable in: 01:14:40 Preference will be: 170
含义
此输出表示显示的路由的掩码长度等于或大于 /17,并确认其已正确映射到积极的衰减配置文件。您还可以查看路由的当前(和最后一个)性能值数字,以及如果路由保持稳定,预计路由何时处于活动状态。
验证默认衰减参数是否有效
目的
使用 /16 掩码找到受阻的路由将确认默认参数有效。
行动
在操作模式下,输入 show route damping suppressed detail | match 0/16
命令。
user@R2> show route damping suppressed detail | match 0/16 172.16.0.0/16 (1 entry, 0 announced)
user@R2> show route damping suppressed 172.16.0.0/16 detail inet.0: 15 destinations, 17 routes (6 active, 0 holddown, 11 hidden) 172.16.0.0/16 (1 entry, 0 announced) BGP /-101 Next hop type: Router, Next hop index: 758 Address: 0x9414484 Next-hop reference count: 9 Source: 10.0.0.1 Next hop: 10.0.0.1 via fe-1/2/0.0, selected Session Id: 0x100201 State: <Hidden Ext> Local AS: 200 Peer AS: 100 Age: 1:58 Validation State: unverified Task: BGP_100.10.0.0.1+55922 AS path: 100 I Localpref: 100 Router ID: 192.168.0.1 Merit (last update/now): 3486/3202 Default damping parameters used Last update: 00:01:58 First update: 01:03:01 Flaps: 8 Suppressed. Reusable in: 00:31:40 Preference will be: 170
含义
带有 /16 掩码的路由不受自定义衰减规则的影响。因此,默认的抑制规则有效。
要重复这些,自定义规则如下所示:
抑制掩码长度等于或大于 17 的所有前缀,比掩码长度在 9 到 16 之间的路由要积极。
掩码长度在 0 到 8(含)之间的衰减路由,小于掩码长度大于 8 的路由。
完全不损害 10.128.0.0/9 前缀。
过滤抑制信息
目的
使用或分组或级联管道,可以简化确定哪些阻尼配置文件用于给定掩码长度的路由。
行动
在操作模式下,输入 show route damping suppressed
命令。
user@R2> show route damping suppressed detail | match "0 announced | damp" 0.0.0.0/0 (1 entry, 0 announced) damping-parameters: timid 10.0.0.0/9 (1 entry, 0 announced) Default damping parameters used damping-parameters: aggressive damping-parameters: aggressive 10.224.0.0/11 (1 entry, 0 announced) Default damping parameters used 172.16.0.0/16 (1 entry, 0 announced) Default damping parameters used 172.16.128.0/17 (1 entry, 0 announced) damping-parameters: aggressive 172.16.192.0/20 (1 entry, 0 announced) damping-parameters: aggressive 192.168.0.1/32 (1 entry, 0 announced) damping-parameters: aggressive 192.168.0.3/32 (1 entry, 0 announced) damping-parameters: aggressive 172.16.233.0/7 (1 entry, 0 announced) damping-parameters: timid
含义
如果确定 EBGP 路由与抑制配置文件正确关联,则可以发出 clear bgp damping
操作模式命令以将受阻的路由恢复为活动状态,从而恢复正常连接。
示例:基于 MBGP MVPN 地址家族配置 BGP 路由抖动抑制
此示例说明如何在 BGP 路由翻动抑制下配置多协议 BGP 组播 VPN(也称为新一代 MVPN)。
要求
此示例使用 Junos OS 12.2 版。Junos OS 12.2 版中引入了 BGP 路由抖动,具体来说,是基于地址家族的一般,抑制对 MBGP MVPN 的支持。
概述
BGP 路由抖动抑制功能有助于减少在链路间歇性出现故障时,由于路由被反复撤销和重转而导致的路由不稳定性。
此示例使用默认衰减参数,并演示了包含三个提供商边缘 (PE) 路由设备、三个客户边缘 (CE) 路由设备和一个提供商 (P) 路由设备的 MBGP MVPN 方案。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
。
设备 R1
set interfaces ge-1/2/0 unit 1 family inet address 10.1.1.1/30 set interfaces ge-1/2/0 unit 1 family mpls set interfaces lo0 unit 1 family inet address 172.16.1.1/32 set protocols ospf area 0.0.0.0 interface lo0.1 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.1 set protocols pim rp static address 172.16.100.1 set protocols pim interface all set routing-options router-id 172.16.1.1
设备 R2
set interfaces ge-1/2/0 unit 2 family inet address 10.1.1.2/30 set interfaces ge-1/2/0 unit 2 family mpls set interfaces ge-1/2/1 unit 5 family inet address 10.1.1.5/30 set interfaces ge-1/2/1 unit 5 family mpls set interfaces vt-1/2/0 unit 2 family inet set interfaces lo0 unit 2 family inet address 172.16.1.2/32 set interfaces lo0 unit 102 family inet address 172.16.100.1/32 set protocols mpls interface ge-1/2/1.5 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 172.16.1.2 set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp family inet-mvpn signaling set protocols bgp group ibgp neighbor 172.16.1.4 set protocols bgp group ibgp neighbor 172.16.1.5 set protocols ospf area 0.0.0.0 interface lo0.2 passive set protocols ospf area 0.0.0.0 interface ge-1/2/1.5 set protocols ldp interface ge-1/2/1.5 set protocols ldp p2mp set policy-options policy-statement parent_vpn_routes from protocol bgp set policy-options policy-statement parent_vpn_routes then accept set routing-instances vpn-1 instance-type vrf set routing-instances vpn-1 interface ge-1/2/0.2 set routing-instances vpn-1 interface vt-1/2/0.2 set routing-instances vpn-1 interface lo0.102 set routing-instances vpn-1 route-distinguisher 100:100 set routing-instances vpn-1 provider-tunnel ldp-p2mp set routing-instances vpn-1 vrf-target target:1:1 set routing-instances vpn-1 protocols ospf export parent_vpn_routes set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface lo0.102 passive set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface ge-1/2/0.2 set routing-instances vpn-1 protocols pim rp static address 172.16.1.2 with 172.16.4.1100.1 set routing-instances vpn-1 protocols pim interface ge-1/2/0.2 mode sparse set routing-instances vpn-1 protocols mvpn set routing-options router-id 172.16.1.2 set routing-options autonomous-system 1001
设备 R3
set interfaces ge-1/2/0 unit 6 family inet address 10.1.1.6/30 set interfaces ge-1/2/0 unit 6 family mpls set interfaces ge-1/2/1 unit 9 family inet address 10.1.1.9/30 set interfaces ge-1/2/1 unit 9 family mpls set interfaces ge-1/2/2 unit 13 family inet address 10.1.1.13/30 set interfaces ge-1/2/2 unit 13 family mpls set interfaces lo0 unit 3 family inet address 172.16.1.3/32 set protocols mpls interface ge-1/2/0.6 set protocols mpls interface ge-1/2/1.9 set protocols mpls interface ge-1/2/2.13 set protocols ospf area 0.0.0.0 interface lo0.3 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.6 set protocols ospf area 0.0.0.0 interface ge-1/2/1.9 set protocols ospf area 0.0.0.0 interface ge-1/2/2.13 set protocols ldp interface ge-1/2/0.6 set protocols ldp interface ge-1/2/1.9 set protocols ldp interface ge-1/2/2.13 set protocols ldp p2mp set routing-options router-id 172.16.1.3
设备 R4
set interfaces ge-1/2/0 unit 10 family inet address 10.1.1.10/30 set interfaces ge-1/2/0 unit 10 family mpls set interfaces ge-1/2/1 unit 17 family inet address 10.1.1.17/30 set interfaces ge-1/2/1 unit 17 family mpls set interfaces vt-1/2/0 unit 4 family inet set interfaces lo0 unit 4 family inet address 172.16.1.4/32 set interfaces lo0 unit 104 family inet address 172.16.100.1/32 set protocols rsvp interface all aggregate set protocols mpls interface all set protocols mpls interface ge-1/2/0.10 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 172.16.1.4 set protocols bgp group ibgp family inet-vpn unicast set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp family inet-mvpn signaling damping set protocols bgp group ibgp neighbor 172.16.1.2 import dampPolicy set protocols bgp group ibgp neighbor 172.16.1.5 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.4 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.10 set protocols ldp interface ge-1/2/0.10 set protocols ldp p2mp set policy-options policy-statement dampPolicy term term1 from family inet-mvpn set policy-options policy-statement dampPolicy term term1 from nlri-route-type 3 set policy-options policy-statement dampPolicy term term1 from nlri-route-type 4 set policy-options policy-statement dampPolicy term term1 from nlri-route-type 5 set policy-options policy-statement dampPolicy term term1 then accept set policy-options policy-statement dampPolicy then damping no-damp set policy-options policy-statement dampPolicy then accept set policy-options policy-statement parent_vpn_routes from protocol bgp set policy-options policy-statement parent_vpn_routes then accept set policy-options damping no-damp disable set routing-instances vpn-1 instance-type vrf set routing-instances vpn-1 interface vt-1/2/0.4 set routing-instances vpn-1 interface ge-1/2/1.17 set routing-instances vpn-1 interface lo0.104 set routing-instances vpn-1 route-distinguisher 100:100 set routing-instances vpn-1 vrf-target target:1:1 set routing-instances vpn-1 protocols ospf export parent_vpn_routes set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface lo0.104 passive set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface ge-1/2/1.17 set routing-instances vpn-1 protocols pim rp static address 172.16.100.1 set routing-instances vpn-1 protocols pim interface ge-1/2/1.17 mode sparse set routing-instances vpn-1 protocols mvpn set routing-options router-id 172.16.1.4 set routing-options autonomous-system 64501
设备 R5
set interfaces ge-1/2/0 unit 14 family inet address 10.1.1.14/30 set interfaces ge-1/2/0 unit 14 family mpls set interfaces ge-1/2/1 unit 21 family inet address 10.1.1.21/30 set interfaces ge-1/2/1 unit 21 family mpls set interfaces vt-1/2/0 unit 5 family inet set interfaces lo0 unit 5 family inet address 172.16.1.5/32 set interfaces lo0 unit 105 family inet address 172.16.100.5/32 set protocols mpls interface ge-1/2/0.14 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 172.16.1.5 set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp family inet-mvpn signaling set protocols bgp group ibgp neighbor 172.16.1.2 set protocols bgp group ibgp neighbor 172.16.1.4 set protocols ospf area 0.0.0.0 interface lo0.5 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.14 set protocols ldp interface ge-1/2/0.14 set protocols ldp p2mp set policy-options policy-statement parent_vpn_routes from protocol bgp set policy-options policy-statement parent_vpn_routes then accept set routing-instances vpn-1 instance-type vrf set routing-instances vpn-1 interface vt-1/2/0.5 set routing-instances vpn-1 interface ge-1/2/1.21 set routing-instances vpn-1 interface lo0.105 set routing-instances vpn-1 route-distinguisher 100:100 set routing-instances vpn-1 vrf-target target:1:1 set routing-instances vpn-1 protocols ospf export parent_vpn_routes set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface lo0.105 passive set routing-instances vpn-1 protocols ospf area 0.0.0.0 interface ge-1/2/1.21 set routing-instances vpn-1 protocols pim rp static address 172.16.100.2 set routing-instances vpn-1 protocols pim interface ge-1/2/1.21 mode sparse set routing-instances vpn-1 protocols mvpn set routing-options router-id 172.16.1.5 set routing-options autonomous-system 1001
设备 R6
set interfaces ge-1/2/0 unit 18 family inet address 10.1.1.18/30 set interfaces ge-1/2/0 unit 18 family mpls set interfaces lo0 unit 6 family inet address 172.16.1.6/32 set protocols sap listen 233.1.1.1 set protocols ospf area 0.0.0.0 interface lo0.6 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.18 set protocols pim rp static address 172.16.100.2 set protocols pim interface all set routing-options router-id 172.16.1.6
设备 R7
set interfaces ge-1/2/0 unit 22 family inet address 10.1.1.22/30 set interfaces ge-1/2/0 unit 22 family mpls set interfaces lo0 unit 7 family inet address 172.16.1.7/32 set protocols ospf area 0.0.0.0 interface lo0.7 passive set protocols ospf area 0.0.0.0 interface ge-1/2/0.22 set protocols pim rp static address 172.16.100.2 set protocols pim interface all set routing-options router-id 172.16.1.7
配置设备 R4
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置设备 R4:
配置接口。
[edit interfaces] user@R4# set ge-1/2/0 unit 10 family inet address 10.1.1.10/30 user@R4# set ge-1/2/0 unit 10 family mpls user@R4# set ge-1/2/1 unit 17 family inet address 10.1.1.17/30 user@R4# set ge-1/2/1 unit 17 family mpls user@R4# set vt-1/2/0 unit 4 family inet user@R4# set lo0 unit 4 family inet address 172.16.1.4/32 user@R4# set lo0 unit 104 family inet address 172.16.100.4/32
在接口上配置 MPLS 和信令协议。
[edit protocols] user@R4# set mpls interface all user@R4# set mpls interface ge-1/2/0.10 user@R4# set rsvp interface all aggregate user@R4# set ldp interface ge-1/2/0.10 user@R4# set ldp p2mp
配置 BGP。
BGP 配置支持对地址家族进行
inet-mvpn
BGP 路由翻动抑制。BGP 配置还会将名为dampPolicy
的路由策略导入路由表中。此策略应用于邻接方 PE 设备 R2。[edit protocols bgp group ibgp] user@R4# set type internal user@R4# set local-address 172.16.1.4 user@R4# set family inet-vpn unicast user@R4# set family inet-vpn any user@R4# set family inet-mvpn signaling damping user@R4# set neighbor 172.16.1.2 import dampPolicy user@R4# set neighbor 172.16.1.5
配置内部网关协议。
[edit protocols ospf] user@R4# set traffic-engineering [edit protocols ospf area 0.0.0.0] user@R4# set interface all user@R4# set interface lo0.4 passive user@R4# set interface ge-1/2/0.10
配置一个抑制策略,使用该
nlri-route-type
匹配条件仅抑制 3、4 和 5 类 MVPN 路由。[edit policy-options policy-statement dampPolicy term term1] user@R4# set from family inet-mvpn user@R4# set from nlri-route-type 3 user@R4# set from nlri-route-type 4 user@R4# set from nlri-route-type 5 user@R4# set then accept
配置
damping
策略以禁用 BGP 路由抖动抑制。策略
no-damp
(damping no-damp disable
) 会导致删除路由表中存在的任何抑制状态。语句then damping no-damp
将no-damp
策略应用为操作,没有from
匹配条件。因此,所有不匹配term1
的路由都会被此术语匹配,从而不会抑制所有其他 MVPN 路由类型。[edit policy-options policy-statement dampPolicy] user@R4# set then damping no-damp user@R4# set then accept [edit policy-options] user@R4# set damping no-damp disable
配置以
parent_vpn_routes
接受不是来自inet-mvpn
地址家族的所有其他 BGP 路由。此策略会作为路由实例中的 OSPF 导出策略应用。
[edit policy-options policy-statement parent_vpn_routes] user@R4# set from protocol bgp user@R4# set then accept
配置 VPN 路由和转发 (VRF) 实例。
[edit routing-instances vpn-1] user@R4# set instance-type vrf user@R4# set interface vt-1/2/0.4 user@R4# set interface ge-1/2/1.17 user@R4# set interface lo0.104 user@R4# set route-distinguisher 100:100 user@R4# set vrf-target target:1:1 user@R4# set protocols ospf export parent_vpn_routes user@R4# set protocols ospf area 0.0.0.0 interface lo0.104 passive user@R4# set protocols ospf area 0.0.0.0 interface ge-1/2/1.17 user@R4# set protocols pim rp static address 172.16.100.2 user@R4# set protocols pim interface ge-1/2/1.17 mode sparse user@R4# set protocols mvpn
配置路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@R4# set router-id 172.16.1.4 user@R4# set autonomous-system 1001
完成设备配置后,提交配置。
user@R4# commit
结果
在配置模式下,输入 、 show interfaces
show protocols
、 show policy-options
、 show routing-instances
和show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R4# show interfaces ge-1/2/0 { unit 10 { family inet { address 10.1.1.10/30; } family mpls; } } ge-1/2/1 { unit 17 { family inet { address 10.1.1.17/30; } family mpls; } } vt-1/2/0 { unit 4 { family inet; } } lo0 { unit 4 { family inet { address 172.16.1.4/32; } } unit 104 { family inet { address 172.16.100.4/32; } } }
user@R4# show protocols rsvp { interface all { aggregate; } } mpls { interface all; interface ge-1/2/0.10; } bgp { group ibgp { type internal; local-address 172.16.1.4; family inet-vpn { unicast; any; } family inet-mvpn { signaling { damping; } } neighbor 172.16.1.2 { import dampPolicy; } neighbor 172.16.1.5; } } ospf { traffic-engineering; area 0.0.0.0 { interface all; interface lo0.4 { passive; } interface ge-1/2/0.10; } } ldp { interface ge-1/2/0.10; p2mp; }
user@R4# show policy-options policy-statement dampPolicy { term term1 { from { family inet-mvpn; nlri-route-type [ 3 4 5 ]; } then accept; } then { damping no-damp; accept; } } policy-statement parent_vpn_routes { from protocol bgp; then accept; } damping no-damp { disable; }
user@R4# show routing-instances vpn-1 { instance-type vrf; interface vt-1/2/0.4; interface ge-1/2/1.17; interface lo0.104; route-distinguisher 100:100; vrf-target target:1:1; protocols { ospf { export parent_vpn_routes; area 0.0.0.0 { interface lo0.104 { passive; } interface ge-1/2/1.17; } } pim { rp { static { address 172.16.100.2; } } interface ge-1/2/1.17 { mode sparse; } } mvpn; } }
user@R4# show routing-optons router-id 172.16.1.4; autonomous-system 1001;
验证
确认配置工作正常。
验证路由抖动抑制是否已禁用
目的
验证策略是否存在 no-damp
,这会禁用除 3、4 和 5 以外的 MVPN 路由类型的抑制功能。
行动
在操作模式下,输入 show policy damping
命令。
user@R4> show policy damping Default damping information: Halflife: 15 minutes Reuse merit: 750 Suppress/cutoff merit: 3000 Maximum suppress time: 60 minutes Computed values: Merit ceiling: 12110 Maximum decay: 6193 Damping information for "no-damp": Damping disabled
含义
输出显示,默认衰减参数有效, no-damp
并且策略也对指定的路由类型有效。
验证路由抖动抑制
目的
检查 BGP 路由是否已被抑制。
行动
在操作模式下,输入 show bgp summary
命令。
user@R4> show bgp summary Groups: 1 Peers: 2 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 6 6 0 0 0 0 bgp.l3vpn.2 0 0 0 0 0 0 bgp.mvpn.0 2 2 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 172.16.1.2 1001 3159 3155 0 0 23:43:47 Establ bgp.l3vpn.0: 3/3/3/0 bgp.l3vpn.2: 0/0/0/0 bgp.mvpn.0: 1/1/1/0 vpn-1.inet.0: 3/3/3/0 vpn-1.mvpn.0: 1/1/1/0 172.16.1.5 1001 3157 3154 0 0 23:43:40 Establ bgp.l3vpn.0: 3/3/3/0 bgp.l3vpn.2: 0/0/0/0 bgp.mvpn.0: 1/1/1/0 vpn-1.inet.0: 3/3/3/0 vpn-1.mvpn.0: 1/1/1/0
含义
“衰减状态”字段表示 bgp.mvpn.0 路由表中没有路由已衰减。此外,“状态”字段中的最后一个数字表示 BGP 对等方 172.16.1.2 的路由为 0。
了解用于防止路由翻动的 BGP 静态路由
BGP 静态路由可配置以确保前缀不会翻动。除非手动删除 BGP 静态路由,否则不会翻动。如果 BGP 静态路由是全局配置的,则必须显式配置每个邻接方、组或所有邻接方以接收它们。无论播发路由器获知这些前缀的动态路由信息,对等路由器都会收到这些路由的播发。尽管是活动路由,但 BGP 静态路由永远不会播发给未为其配置的 BGP 邻接方。您可以在配置中指定任意数量的 BGP 静态路由。您还可以定义一个策略,以指定需要播发并包含在 BGP 播发中的 BGP 静态路由。
BGP 静态路由被放置在路由表中。如果 BGP 静态路由是活动路由(如果该前缀没有其他路由),则会将其置于转发表。这些路由仅播发至配置为接收这些路由的 BGP 主机。除 BGP 外,配置了 BGP 静态路由不会由任何其他协议播发。如果服务提供商拥有一个或多个单宿主客户,则可以在 BGP 网络上配置 BGP 静态路由,以便为这些客户播发静态路径。
在邻接方级别配置 BGP 静态路由播发会导致内部组拆分。仅在全局和组级别配置 BGP 静态路由的播发,以确保配置简单。配置的 BGP 静态路由不会影响播发的 VPN 路由。
如果 BGP 静态路由播发给邻接方,则它是唯一为前缀播发的路由。BGP 静态路由不被视为 BGP 多路径或与协议无关的多路径的候选路由。它们不会将聚合或生成的路由添加到路由表中。
在可供多个路径访问且不是所有路径的唯一接入点的网络上配置 BGP 静态路由可能会导致流量被无提示丢弃。在多宿主网络中,可以在作为其他路径唯一接入点的设备上配置 BGP 静态路由。默认情况下,播发给内部对等方的所有 BGP 静态路由均包含一个 local-pref
值 0
,以降低多宿主网络空路由的风险。您可以通过在 BGP 静态路由上设置显式 preference2
值来覆盖此默认值。
另请参阅
配置 BGP 静态路由以防止路由翻动
配置 BGP 静态路由可确保到客户网络的路由不会翻动。除 BGP 外,配置了 BGP 静态路由不会由任何其他协议播发。BGP 静态路由是全局配置的,但每个邻接方、组或所有邻接方都必须显式配置以接收它们。无论播发路由器获知这些前缀的动态路由信息,对等路由器都将接收这些路由的播发。您可以在配置中指定任意数量的 BGP 静态路由。您还可以定义一个策略来指定需要播发哪些 BGP 静态路由。
配置 BGP 静态路由之前:
确保 IGP 和 BGP 协议已配置并正常工作。
确保您配置的 BGP 静态路由在客户路由器后面。
请勿将 BGP 静态路由用于 BGP 邻接方前缀。
要配置 BGP 静态路由:
另请参阅
示例:配置 BGP 静态路由以防止路由翻动
此示例说明如何配置 BGP 静态路由。BGP 主机仅将这些 BGP 静态路由播发至配置为接收这些路由的邻接方。配置了 BGP 静态路由以确保前缀不会翻动。但是,如果 BGP 静态路由是全局配置的,则必须显式配置每个邻接方、组或所有邻接方以接收它们。
要求
此示例使用以下硬件和软件组件:
在连接的接口上启用 BGP 的 7 个 MX 系列路由器
在所有设备上运行的 Junos OS 14.2 或更高版本
概述
从 Junos OS 14.2 版开始,您可以在 BGP 网络中配置和播发 BGP 静态路由。您可以在 BGP 网络中播发 BGP 静态路由,即使它不是前缀的活动路由。除非手动删除 BGP 静态路由,否则不会翻动。您可以定义一个策略,用于确定需要播发和包含在播发中的 BGP 静态路由。无论播发路由器获知什么动态路由信息,对等路由器都会收到这些 BGP 静态路由的播发。
在示例 BGP 网络中,设备 CE1、CE2 和 CE3 直接连接到路由器 PE1、PE2 和 PE3。PE1 和 PE2 均连接到路由器 P。路由器 P 直接连接到路由器 PE3。EBGP 在提供商边缘和客户边缘路由器上配置。IBGP 在直接连接的提供商边缘路由器上配置。所有提供商路由器上都配置了 IGP 协议 IS-IS。在路由器 PE1 上配置 BGP 静态路由,以确保 CE1 后面的客户路由 10.0.0.28 不会翻动。提供商路由器 PE2 配置为接收 BGP 静态路由。其目标是将 BGP 静态路由仅播发至 CE2,而不是播发至 CE3,并证明配置的 BGP 静态路由不会翻动。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层级的 [edit] CLI 中,然后从配置模式进入 commit
。
路由器 P
set interfaces ge-1/0/0 unit 2 description P->PE1 set interfaces ge-1/0/0 unit 2 family inet address 10.0.0.2/29 set interfaces ge-1/0/0 unit 2 family iso set interfaces ge-1/0/1 unit 5 description P->PE2 set interfaces ge-1/0/1 unit 5 family inet address 10.0.0.5/29 set interfaces ge-1/0/1 unit 5 family iso set interfaces ge-1/1/2 unit 3 description P->PE3 set interfaces ge-1/1/2 unit 3 family inet address 10.0.0.3/29 set interfaces ge-1/1/2 unit 3 family iso set interfaces lo0 unit 0 family inet address 10.255.102.146/32 primary set interfaces lo0 unit 0 family iso address 49.0001.1720.1600.1050.00 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 10.255.102.146 set protocols bgp group ibgp neighbor 10.255.102.128 description PE1 set protocols bgp group ibgp neighbor 10.255.102.178 description PE2 set protocols bgp group ibgp neighbor 10.255.102.156 description PE3 set protocols isis interface ge-1/0/0.2 set protocols isis interface ge-1/0/1.5 set protocols isis interface ge-1/1/2.3 set protocols isis interface lo0.0 passive set routing-options router-id 10.255.102.146 set routing-options autonomous-system 64496
路由器 PE1
set interfaces ge-1/0/0 unit 1 description PE1->P set interfaces ge-1/0/0 unit 1 family inet address 10.0.0.1/29 set interfaces ge-1/0/0 unit 1 family iso set interfaces ge-1/1/0 unit 10 description PE1->CE1 set interfaces ge-1/1/0 unit 10 family inet address 10.0.0.10/30 set interfaces lo0 unit 0 family inet address 10.255.102.128/32 set interfaces lo0 unit 0 family iso address 49.0001.1720.1600.1010.00 set protocols bgp group ebgp type external set protocols bgp group ebgp peer-as 64497 set protocols bgp group ebgp neighbor 10.0.0.9 description CE1 set protocols bgp group ebgp neighbor 10.0.0.9 local-address 10.0.0.10 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 10.255.102.128 set protocols bgp group ibgp export export-self set protocols bgp group ibgp neighbor 10.255.102.146 description P set protocols bgp group ibgp neighbor 10.255.102.178 description PE2 set protocols bgp group ibgp neighbor 10.255.102.178 advertise-bgp-static set protocols bgp group ibgp neighbor 10.255.102.156 description PE3 set protocols isis interface ge-1/0/0.1 set protocols isis interface lo0.0 passive set policy-options policy-statement export-self then next-hop self set routing-options bgp-static route 10.0.0.28/32 preference2 4294967195 set routing-options bgp-static route 10.0.0.28/32 as-path path 64497 set routing-options router-id 10.255.102.128 set routing-options autonomous-system 64496
路由器 PE2
set interfaces ge-1/0/1 unit 6 description PE2->P set interfaces ge-1/0/1 unit 6 family inet address 10.0.0.6/29 set interfaces ge-1/0/1 unit 6 family iso set interfaces ge-1/1/2 unit 14 description PE2->CE2 set interfaces ge-1/1/2 unit 14 family inet address 10.0.0.14/30 set interfaces lo0 unit 0 family inet address 10.255.102.178/32 set interfaces lo0 unit 0 family iso address 49.0001.1720.1600.1030.00 set protocols bgp group ebgp type external set protocols bgp group ebgp peer-as 64498 set protocols bgp group ebgp neighbor 10.0.0.13 description CE2 set protocols bgp group ebgp neighbor 10.0.0.13 local-address 10.0.0.14 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 10.255.102.178 set protocols bgp group ibgp export export-self set protocols bgp group ibgp neighbor 10.255.102.146 description P set protocols bgp group ibgp neighbor 10.255.102.128 description PE1 set protocols bgp group ibgp neighbor 10.255.102.156 description PE3 set protocols isis interface ge-1/0/1.6 set protocols isis interface lo0.0 passive set policy-options policy-statement export-self then next-hop self set routing-options router-id 10.255.102.178 set routing-options autonomous-system 64496
路由器 PE3
set interfaces ge-2/0/1 unit 4 description PE3->P set interfaces ge-2/0/1 unit 4 family inet address 10.0.0.4/29 set interfaces ge-2/0/5 unit 18 description PE3->CE3 set interfaces ge-2/0/5 unit 18 family inet address 10.0.0.18/30 set interfaces lo0 unit 0 family inet address 10.255.102.156/32 set interfaces lo0 unit 0 family iso address 49.0001.1720.1600.1070.00 set protocols bgp group ebgp type external set protocols bgp group ebgp peer-as 64499 set protocols bgp group ebgp neighbor 10.0.0.17 description CE3 set protocols bgp group ebgp neighbor 10.0.0.17 local-address 10.0.0.18 set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 10.255.102.156 set protocols bgp group ibgp export export-self set protocols bgp group ibgp neighbor 10.255.102.146 description P set protocols bgp group ibgp neighbor 10.255.102.128 description PE1 set protocols bgp group ibgp neighbor 10.255.102.178 description PE2 set protocols isis interface ge-2/0/1.4 set protocols isis interface lo0.0 passive set policy-options policy-statement export-self then next-hop self set routing-options router-id 10.255.102.156 set routing-options autonomous-system 64496
路由器 CE1
set interfaces ge-2/0/8 unit 9 description CE1->PE1 set interfaces ge-2/0/8 unit 9 family inet address 10.0.0.9/30 set interfaces lo0 unit 0 family inet address 127.255.102.166/32 set interfaces lo0 unit 0 family inet address 10.0.0.28/32 set protocols bgp group ebgp type external set protocols bgp group ebgp export export-direct set protocols bgp group ebgp peer-as 64496 set protocols bgp group ebgp neighbor 10.0.0.10 description PE1 set protocols bgp group ebgp neighbor 10.0.0.10 local-address 10.0.0.9 set policy-options policy-statement export-direct from protocol direct route-filter 10.0.0.0/29 or longer set policy-options policy-statement export-direct then accept set routing-options autonomous-system 64497
路由器 CE2
set interfaces ge-2/0/0 unit 13 description CE2->PE2 set interfaces ge-2/0/0 unit 13 family inet address 10.0.0.13/30 set interfaces lo0 unit 0 family inet address 127.255.102.176/32 set protocols bgp group ebgp type external set protocols bgp export export-direct set protocols bgp group ebgp peer-as 64496 set protocols bgp group ebgp neighbor 10.0.0.14 description PE2 set protocols bgp group ebgp neighbor 10.0.0.14 local-address 10.0.0.13 set policy-options policy-statement export-direct from protocol direct route-filter 10.0.0.0/29 or longer set policy-options policy-statement export-direct then accept set routing-options router-id 127.255.102.176 set routing-options autonomous-system 64498
路由器 CE3
set interfaces ge-2/0/5 unit 17 description CE3->PE3 set interfaces ge-2/0/5 unit 17 family inet address 10.0.0.17/30 set interfaces lo0 unit 0 family inet address 127.255.102.186/32 set protocols bgp group ebgp type external set protocols bgp export export-direct set protocols bgp group ebgp peer-as 64496 set protocols bgp group ebgp neighbor 10.0.0.18 description PE3 set protocols bgp group ebgp neighbor 10.0.0.18 local-address 10.0.0.17 set policy-options policy-statement export-direct from protocol direct route-filter 10.0.0.0/29 or longer set policy-options policy-statement export-direct then accept set routing-options router-id 127.255.102.186 set routing-options autonomous-system 64499
程序
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用CLI 编辑器。
要配置路由器 PE1:
使用 IPv4 地址配置接口。
[edit interfaces] user@PE1# set ge-1/0/0 unit 1 description PE1->P user@PE1# set ge-1/0/0 unit 1 family inet address 10.0.0.1/29 user@PE1# set ge-1/1/0 unit 10 description PE1->CE1 user@PE1# set ge-1/1/0 unit 10 family inet address 10.0.0.10/30
在连接到提供商路由器的接口上启用 IS-IS 协议,以便学习和交换学习的路由。
[edit interfaces] user@PE1# set ge-1/0/0 unit 1 family iso
为 inet 和 IS-IS 配置环路地址。
[edit interfaces lo0 unit 0] user@PE1# set family inet address 10.255.102.128/32 user@PE1# set family iso address 49.0001.1720.1600.1010.00
配置 IS-IS 接口。
[edit protocols isis] user@PE1# set interface ge-1/0/0.1 user@PE1# set interface lo0.0 passive
配置 EBGP。
[edit protocols bgp group ebgp] user@PE1# set type external user@PE1# set peer-as 64497 user@PE1# set neighbor 10.0.0.9 description CE1 user@PE1# set neighbor 10.0.0.9 local-address 10.0.0.10
在连接到提供商网络的内部路由器上配置 IBGP 邻接方。
[edit protocols bgp group ibgp] user@PE1# set type internal user@PE1# set local-address 10.255.102.128 user@PE1# set export export-self user@PE1# set neighbor 10.255.102.146 description P user@PE1# set neighbor 10.255.102.178 description PE2 user@PE1# set neighbor 10.255.102.156 description PE3
配置 BGP 静态路由。
[edit routing-options] user@PE1# set bgp-static route 10.0.0.28/32 preference2 4294967195 user@PE1# set bgp-static route 10.0.0.28/32 as-path path 64497
配置 BGP 邻接方 PE2 以接收 BGP 静态播发。
[edit protocols bgp group ibgp neighbor 10.255.102.178] user@PE1# set advertise-bgp-static
定义将路由导出到 BGP 网络的策略。
[edit policy-options policy-statement export-self] user@PE1# set then next-hop self
将策略应用于 IBGP 组。
[edit protocols bgp group ibgp] user@PE1# set export export-self
配置路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@PE1# set router-id 10.255.102.128 user@PE1# set autonomous-system 64496
结果
在配置模式下,输入 show interfaces、 show policy-options、 show protocols和 show routing-options 命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
[edit] user@PE1> show interfaces ge-1/0/0 { unit 1 { description PE1->P; family inet { address 10.0.0.1/29; } family iso; } ge-1/1/0 { unit 10 { description PE1->CE1; family inet { address 10.0.0.10/30; } } } } lo0 { unit 0{ family inet { address 10.255.102.128/32; } family iso { address 49.0001.1720.1600.1010.00; } } }
[edit] user@PE1> show protocols bgp { group ebgp { type external; peer-as 64497; neighbor 10.0.0.9 { description CE1; local-address 10.0.0.10; } } group ibgp { type internal; local-address 10.255.102.128; export export-self; neighbor 10.255.102.146 { description P; } neighbor 10.255.102.178 { description PE2; advertise-bgp-static; } neighbor 10.255.102.156 { description PE3; } } } isis { interface ge-1/0/0.1; interface lo0.0 { passive; } }
[edit] user@PE1> show routing-options bgp-static { route 10.0.0.28/32 { preference2 4294967195; as-path { path 64497; } } } router-id 10.255.102.128; autonomous-system 64496;
[edit] user@PE1> show policy-options policy-statement export-self { then { next-hop self; } }
完成设备配置后,请从配置模式进入 commit
。
[edit] user@PE1# commit
验证
确认配置工作正常。
验证 BGP 邻接方
目的
验证 BGP 是否在配置的接口上运行,以及 BGP 会话对于每个邻接方地址是否处于活动状态。
行动
在操作模式下,在 show bgp neighbor 路由器 PE1 上运行命令。
user@PE1> show bgp neighbor Peer: 10.0.0.9+34260 AS 64497 Local: 10.0.0.10+45824 AS 64496 Description: CE1 Type: External State: Established Flags: <sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: Cease Options: <Preference LocalAddress PeerAS Refresh> LocalAddress: 10.0.0.10 Holdtime: 90 Preference: 170 Number of flaps: 0 Peer ID: 127.255.102.166 Local ID: 10.255.102.128 Active Holdtime: 90 Keepalive Interval: 30 Group index: 0 Peer index: 0 BFD: disabled, down Local Interface: ge-1/1/0.0 NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 64497) Peer does not support Addpath Table inet.0 Bit: 10000 RIB State: BGP restart is complete Send state: in sync Active prefixes: 1 Received prefixes: 1 Accepted prefixes: 1 Suppressed due to damping: 0 Advertised prefixes: 2 Last traffic (seconds): Received 14 Sent 13 Checked 4 Input messages: Total 249 Updates 2 Refreshes 0 Octets 4764 Output messages: Total 250 Updates 2 Refreshes 0 Octets 4883 Peer: 10.255.102.146+179 AS 64496 Local: 10.255.102.128+53460 AS 64496 Description: P Type: Internal State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ export-self ] Options: <Preference LocalAddress Refresh> Local Address: 10.255.102.128 Holdtime: 90 Preference: 170 Number of flaps: 0 Peer ID: 10.255.102.146 Local ID: 10.255.102.128 Active Holdtime: 90 Keepalive Interval: 30 Group index: 0 Peer index: 0 BFD: disabled, down NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality Restart flag received from the peer: Notification NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer does not support LLGR Restarter functionality Peer supports 4 byte AS extension (peer-as 64496) Peer does not support Addpath Table inet.0 Bit: 10001 RIB State: BGP restart is complete Send state: in sync Active prefixes: 0 Received prefixes: 0 Accepted prefixes: 0 Suppressed due to damping: 0 Advertised prefixes: 1 Last traffic (seconds): Received 12 Sent 1 Checked 63 Input messages: Total 246 Updates 1 Refreshes 0 Octets 4678 Output messages: Total 249 Updates 1 Refreshes 0 Octets 4834 Output Queue[0]: 0 (inet.0, inet-unicast) Peer: 10.255.102.178+53463 AS 64496 Local: 10.255.102.128+179 AS 64496 Description: PE2 Type: Internal State: Established Flags: <Synch> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ export-self ] Options: <Preference LocalAddress Refresh> Options: <AdvertiseBGPStatic> Local Address: 10.255.102.128 Holdtime: 90 Preference: 170 Number of flaps: 0 Peer ID: 10.255.102.178 Local ID: 10.255.102.128 Active Holdtime: 90 Keepalive Interval: 30 Group index: 1 Peer index: 0 BFD: disabled, down NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality Restart flag received from the peer: Notification NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer does not support LLGR Restarter functionality Peer supports 4 byte AS extension (peer-as 64496) Peer does not support Addpath Table inet.0 Bit: 10002 RIB State: BGP restart is complete Send state: in sync Active prefixes: 1 Received prefixes: 1 Accepted prefixes: 1 Suppressed due to damping: 0 Advertised prefixes: 1 Last traffic (seconds): Received 9 Sent 10 Checked 22 Input messages: Total 247 Updates 2 Refreshes 0 Octets 4777 Output messages: Total 248 Updates 1 Refreshes 0 Octets 4815 Output Queue[0]: 0 (inet.0, inet-unicast) Peer: 10.255.102.156+179 AS 64496 Local: 10.255.102.128+53462 AS 64496 Description: PE3 Type: Internal State: Established Flags: <Synch> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ export-self ] Options: <Preference LocalAddress Refresh> Local Address: 10.255.255.11 Holdtime: 90 Preference: 170 Number of flaps: 0 Peer ID: 10.255.102.156 Local ID: 10.255.102.128 Active Holdtime: 90 Keepalive Interval: 30 Group index: 0 Peer index: 1 BFD: disabled, down NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality Restart flag received from the peer: Notification NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer does not support LLGR Restarter functionality Peer supports 4 byte AS extension (peer-as 64496) Peer does not support Addpath Table inet.0 Bit: 10001 RIB State: BGP restart is complete Send state: in sync Active prefixes: 1 Received prefixes: 1 Accepted prefixes: 1 Suppressed due to damping: 0 Advertised prefixes: 1 Last traffic (seconds): Received 21 Sent 10 Checked 10 Input messages: Total 245 Updates 2 Refreshes 0 Octets 4695 Output messages: Total 247 Updates 1 Refreshes 0 Octets 4796 Output Queue[0]: 0 (inet.0, inet-unicast)
含义
输出显示路由器 PE1 的 BGP 邻接方和配置的 BGP 选项,例如邻接方是否已配置为接收 BGP 静态路由。路由器 PE2 配置为接收 BGP 静态路由通告。
验证 BGP 组
目的
验证预期的 BGP 组或邻接方是否已配置为接收 BGP 静态路由。
行动
在操作模式下,运行 show bgp group 命令。
user@PE1> show bgp group Group Type: External Local AS: 64496 Name: ebgp Index: 3 Flags: <Export Eval> Holdtime: 0 Local AS: 64496 Local System AS: 64496 Total peers: 1 Established: 1 10.0.0.9+179 inet.0: 0/1/1/0 Group Type: Internal AS: 64496 Local AS: 64496 Name: ibgp Index: 0 Flags: <Export Eval> Export: [ export-self ] Options: <AdvertiseBGPStatic> Holdtime: 0 Total peers: 1 Established: 1 10.255.102.178+179 inet.0: 0/0/0/0 Group Type: Internal AS: 64496 Local AS: 64496 Name: ibgp Index: 0 Flags: <Export Eval> Export: [ export-self ] Holdtime: 0 Total peers: 2 Established: 2 10.255.102.156+179 10.255.102.146+179 inet.0: 0/3/2/0 Groups: 3 Peers: 4 External: 1 Internal: 3 Down peers: 0 Flaps: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 3 3 0 0 0 0
含义
输出显示配置为接收 BGP 静态播发的 BGP 邻接方。
验证路由
目的
验证配置的 BGP 静态路由是否已保存在已配置 BGP 邻接方路由表中。
行动
在操作模式下,运行 show route protocol bgp-static 命令以显示路由表。
user@PE1> show route protocol bgp-static inet.0: 13 destinations, 14 routes (13 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.28/32 *[BGP-Static/4294967292/-101] 00:43:15 Discard iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) inet6.0: 15 destinations, 15 routes (15 active, 0 holddown, 0 hidden)
User@PE1> show route 10.0.0.28/32 inet.0: 13 destinations, 14 routes (13 active, 1 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.28/32 *[BGP/170] 00:00:15, localpref 100 AS path: 64497 I, validation-state: unverified > to 10.0.0.9 via ge-2/1/8.0 [BGP-Static/4294967292/-101] 02:42:51 Discard
含义
输出显示设备上配置的 BGP 静态路由。活动路径从 CE1 中学习,BGP 静态路由处于非活动状态。
验证配置的主机是否接收 BGP 静态路由
目的
验证 BGP 静态路由是否已播发至配置为接收该路由的主机。
行动
在设备 CE2 和 CE3 上,从操作模式运行 show route protocol bgp 命令,在路由表中显示学习的路由。
user@CE2> show route protocol bgp inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.28/32 *[BGP/170] 01:52:10, localpref 100 AS path: 64496 64497 I, validation-state: unverified > to 10.0.0.14 via ge-2/0/0.13 1.0.0.29/32 *[BGP/170] 01:52:06, localpref 100 AS path: 64496 64499 I, validation-state: unverified > to 10.0.0.14 via ge-2/0/0.13 iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) inet6.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) user@CE3> show route protocol bgp inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 1.0.0.28/32 *[BGP/170] 01:52:19, localpref 100 AS path: 64496 64497 I, validation-state: unverified > to 10.0.0.18 via ge-2/0/5.17 1.0.0.29/32 *[BGP/170] 01:52:15, localpref 100 AS path: 64496 64498 I, validation-state: unverified > to 10.0.0.18 via ge-2/0/5.17 iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) inet6.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
含义
设备 CE2 和 CE3 都有一条路由到 10.0.0.28/32。CE2 已收到 BGP 静态路由,CE3 已接收动态学习路由,但无法区分。
验证配置的 BGP 静态路由是否没有抖动
目的
验证即使路由器 PE1 和设备 CE1 之间的 BGP 对等会话中断,BGP 静态路由也不会翻动。
行动
停用路由器 PE1 和设备 CE1 之间的 BGP 对等会话。PE1 没有动态学习到 10.0.0.28/32 的路由,但仍具有配置的 BGP 静态路由。
[edit] user@PE1# deactivate protocols bgp group ebgp user@PE1# commit
user@PE1> show route 10.0.0.28/32 inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.28/32 *[BGP-Static/4294967292/-101] 02:46:21 Discard user@CE2> show route protocol bgp inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.28/32 *[BGP/170] 01:52:48, localpref 100 AS path: 64496 64497 I, validation-state: unverified > to 10.0.0.18 via ge-2/0/5.17 1.0.0.29/32 *[BGP/170] 01:52:44, localpref 100 AS path: 64496 64499 I, validation-state: unverified > to 10.0.0.18 via ge-2/0/5.17 iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) inet6.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) user@CE3> show route protocol bgp inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.29/32 *[BGP/170] 01:52:47, localpref 100 AS path: 64496 64498 I, validation-state: unverified > to 10.0.0.18 via ge-2/0/5.17 iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) inet6.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
含义
路由器 PE1 和设备 CE2 仍具有配置的 BGP 静态路由。但是,设备 CE3 没有到 10.0.0.28/32 的路由,因为此前缀已抖动。除非手动删除 BGP 静态路由,否则不会翻动。