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
、、l2vpn
iso-vpn
inet-mpvn
inet6-mpvn
inet-mdt
、 等),则路由反射器 (RR) 内部 BGP (IBGP) 会话或外部 BGP (EBGP) 会话的抖动会导致配置相同 VPN 系列的其他 BGP 会话抖动。 inet6-vpn
要求
准备工作:
配置路由器接口。
配置内部网关协议 (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 不需要传播 VPN 路由,因为会话没有 EBGP 对等方和 RR 客户端,BGP 会将 VPN 路由直接从 instance.inet.0 路由表导出到其他 PE 路由器。此行为非常有效,因为它避免创建许多路由的两个副本(一个在 .inet.0 表中,一个在 instancebgp.l3vpn.0 表中)。
如果 BGP 由于会话具有 EBGP 对等方或 RR 客户端而需要传播 VPN 路由,则 BGP 首先将 VPN 路由从 instance.inet.0 表导出到 bgp.l3vpn.0 表。然后 BGP 将路由导出到其他 PE 路由器。在此方案中,需要路由的两个副本才能启用最佳路由选择。PE 路由器可能从客户边缘设备以及 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。
阻尼参数 |
Description |
默认值 |
可能的值 |
---|---|---|---|
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 显示了示例网络。
#d82e75__d82e262本节介绍设备 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 前缀。
过滤阻尼信息
目的
使用 OR 分组或级联管道来简化确定用于具有给定掩码长度的线路的阻尼轮廓。
操作
在操作模式下,输入 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 版中引入了对 MBGP MVPN 的 BGP 路由抖动阻尼支持,特别是在地址族的基础上。
概述
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
匹配条件的阻尼策略,以仅抑制 MVPN 路由类型 3、4 和 5。[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 routing-instances
show policy-options
和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 的路由已阻尼零。
了解用于防止路由抖动的 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 静态路由是全局配置的,则必须显式配置每个邻居、组或所有邻居才能接收它们。
要求
此示例使用以下硬件和软件组件:
七个在连接的接口上启用了 BGP 的 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 静态路由。目标是仅向 CE2 播发 BGP 静态路由,而不播发到 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 静态路由不会翻动。
变更历史表
是否支持某项功能取决于您使用的平台和版本。 使用 Feature Explorer 查看您使用的平台是否支持某项功能。