“show ip bgp xxxx”中的条目顺序

网络工程 思科 bgp cisco 命令
2021-07-12 17:16:21
Router# show ip bgp 10.3.3.3 255.255.255.255
BGP routing table entry for 10.3.3.3/32, version 35
Paths: (3 available, best #2, table default)
Multipath: eBGP
Flag: 0x860
  Advertised to update-groups:
     1
  200
    10.71.8.165 from 10.71.8.165 (192.168.0.102)
      Origin incomplete, localpref 100, valid, external, backup/repair
      Only allowed to recurse through connected route
  200
    10.71.11.165 from 10.71.11.165 (192.168.0.102)
      Origin incomplete, localpref 100, weight 100, valid, external, best
      Only allowed to recurse through connected route
  200
    10.71.10.165 from 10.71.10.165 (192.168.0.104)
      Origin incomplete, localpref 100, valid, external,
      Only allowed to recurse through connected route 

以上是“show ip bgp xxxx”的示例输出。这个特定的 BGP 路由器已获知到达 10.3.3.3/32 主机的多条路径,并列出每个条目。在学习的三个中,第二个是最好的——因此是进入实际路由表 (RIB) 的条目。

我的问题是,这条命令的输出中出现的三个目标路径的顺序是否表明了什么?如果是这样,这意味着什么?

2个回答

我的问题是,这条命令的输出中出现的三个目标路径的顺序是否表明了什么?如果是这样,这意味着什么?

show ip bgpshow 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 表恢复为标准格式,直到删除/清除并重新学习路由。

命令没有任何意义。这只是从内部结构中检索数据或(可能)排序以使其更平滑的方式。