我的问题是,这条命令的输出中出现的三个目标路径的顺序是否表明了什么?如果是这样,这意味着什么?
show ip bgp
或show ip bgp x.x.x.x
命令列出的接收前缀的顺序因您的 BGP 配置而异。
考虑以下拓扑。BGP 发言者R6
正在聚合 BGP ASN 888 的 eBGP 邻居关系。
ASN 123、1581 和 1771 都源自相同的网络前缀,以演示show ip bgp
输出的行为。
+-------+
| AS 888|
| (R6) |
172.16.13.1 +-+-+-+-+
172.16.13.3 | | |
172.16.26.2 | | | 172.30.4.10
\ | | | /
+--------+ | | | +---------+
| AS 123 +--------+ | +-------+ AS 1771 |
+--------+ | +---------+
|
+----+----+
| AS 1581 | \
+---------+ 172.40.10.10
下面是路由器 6 的 BGP 表的初始视图。
R6#show ip bgp 10.101.1.1/32
BGP routing table entry for 10.101.1.1/32, version 9
Paths: (5 available, best #5, table default)
Advertised to update-groups:
1
Refresh Epoch 1
1771
172.30.4.10 from 172.30.4.10 (172.30.4.10)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
1581
172.40.10.10 from 172.40.10.10 (172.40.10.10)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
123
172.16.13.1 from 172.16.13.1 (172.16.101.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
123
172.16.13.3 from 172.16.13.3 (172.16.103.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
123
172.16.26.2 from 172.16.26.2 (172.16.102.1)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
这些路由可以show ip bgp x.x.x.x
通过控制它们学习的顺序在输出中重新排序。下面,所有通告 10.101.1.1/32 前缀的 eBGP 邻居都在管理上关闭并一次启动一个。
R6(config)#router bgp 888
R6(config-router)#neighbor 172.16.13.1 shutdown
R6(config-router)#neighbor 172.16.13.3 shutdown
R6(config-router)#neighbor 172.16.26.2 shutdown
R6(config-router)#neighbor 172.30.4.10 shutdown
R6(config-router)#neighbor 172.40.10.10 shutdown
R6(config-router)#no neighbor 172.40.10.10 shutdown
*Jun 2 01:39:47.750: %BGP-5-ADJCHANGE: neighbor 172.40.10.10 Up
R6(config-router)#no neighbor 172.16.26.2 shutdown
*Jun 2 01:40:31.929: %BGP-5-ADJCHANGE: neighbor 172.16.26.2 Up
R6(config-router)#no neighbor 172.30.4.10 shutdown
*Jun 2 01:40:49.400: %BGP-5-ADJCHANGE: neighbor 172.30.4.10 Up
R6(config-router)#no neighbor 172.16.13.3 shutdown
*Jun 2 01:41:05.853: %BGP-5-ADJCHANGE: neighbor 172.16.13.3 Up
R6(config-router)#no neighbor 172.16.13.1 shutdown
*Jun 2 01:41:19.225: %BGP-5-ADJCHANGE: neighbor 172.16.13.1 Up
如果未启用确定性 MED,则前缀按时间顺序列出,无论原始 AS 如何,从最年轻到最旧(从上到下)。
R6(config-router)#do show ip bgp 10.101.1.1/32
BGP routing table entry for 10.101.1.1/32, version 52
Paths: (5 available, best #5, table default)
Advertised to update-groups:
3
Refresh Epoch 2
123
172.16.13.1 from 172.16.13.1 (172.16.101.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 2
123
172.16.13.3 from 172.16.13.3 (172.16.103.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
1771
172.30.4.10 from 172.30.4.10 (172.30.4.10)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 2
123
172.16.26.2 from 172.16.26.2 (172.16.102.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
1581
172.40.10.10 from 172.40.10.10 (172.40.10.10)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
如果启用了确定性 MED,则前缀按 ASN 分组。前缀仍按其各自 ASN 组内从最年轻到最旧的时间顺序列出,并且 ASN 组顺序从最年轻到最旧显示,并比较每个组的最年长前缀。
R6(config-router)#bgp deterministic-med
R6(config-router)#do show ip bgp 10.101.1.1/32
BGP routing table entry for 10.101.1.1/32, version 52
BGP Bestpath: deterministic-med
Paths: (5 available, best #4, table default)
Advertised to update-groups:
3
Refresh Epoch 2
123
172.16.13.1 from 172.16.13.1 (172.16.101.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 2
123
172.16.13.3 from 172.16.13.3 (172.16.103.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 2
123
172.16.26.2 from 172.16.26.2 (172.16.102.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
1581
172.40.10.10 from 172.40.10.10 (172.40.10.10)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 1
1771
172.30.4.10 from 172.30.4.10 (172.30.4.10)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
属于 AS 1581 和 1771 的 BGP 邻居可以强制摆动并重新排序 ASN 组。
R6(config-router)#neighbor 172.30.4.10 shutdown
R6(config-router)#neighbor 172.40.10.10 shutdown
R6(config-router)#no neighbor 172.40.10.10 shutdown
R6(config-router)#no neighbor 172.30.4.10 shutdown
*Jun 2 02:23:33.407: %BGP-5-ADJCHANGE: neighbor 172.30.4.10 Up
*Jun 2 02:32:09.242: %BGP-5-ADJCHANGE: neighbor 172.40.10.10 Up
下面最老的路由来自 ASN 123,导致 ASN 组列在show ip bgp x.x.x.x
输出的底部。
R6(config-router)#do show ip bgp 10.101.1.1/32
BGP routing table entry for 10.101.1.1/32, version 10
BGP Bestpath: deterministic-med
Paths: (5 available, best #5, table default)
Advertised to update-groups:
1
Refresh Epoch 1
1581
172.40.10.10 from 172.40.10.10 (172.40.10.10)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
1771
172.30.4.10 from 172.30.4.10 (172.30.4.10)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 2
123
172.16.13.1 from 172.16.13.1 (172.16.101.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 2
123
172.16.13.3 from 172.16.13.3 (172.16.103.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 2
123
172.16.26.2 from 172.16.26.2 (172.16.102.1)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
在启用确定性 MED 的情况下对 BGP 表进行排序后,删除确定性 MED 不会将 BGP 表恢复为标准格式,直到删除/清除并重新学习路由。