BGP 故障排除

使用以下命令来排除 BGP 故障。

显示 BGP 配置摘要

要显示交换机上 BGP 配置的摘要,请运行 NVUE nv show router bgp 命令或 vtysh show ip bgp summary 命令。例如

cumulus@switch:~$ nv show router bgp 
                                applied      pending    
------------------------------  -----------  -----------
enable                          on           on         
autonomous-system               65101        65101      
router-id                       10.10.10.1   10.10.10.1 
policy-update-timer             5            5          
graceful-shutdown               off          off        
wait-for-install                off          off        
graceful-restart                                        
  mode                          helper-only  helper-only
  restart-time                  120          120        
  path-selection-deferral-time  360          360        
  stale-routes-time             360          360        
convergence-wait                                        
  time                          0            0          
  establish-wait-time           0            0          
queue-limit                                             
  input                         10000        10000      
  output                        10000        10000  
cumulus@switch:~$ sudo vtysh
...
switch# show ip bgp summary
ipv4 Unicast Summary
BGP router identifier 10.10.10.1, local AS number 65101 vrf-id 0
BGP table version 88
RIB entries 25, using 4800 bytes of memory
Peers 5, using 106 KiB of memory
Peer groups 1, using 64 bytes of memory

Neighbor              V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
spine01(swp51)        4      65199     31122     31194        0    0    0 1d01h44m            7
spine02(swp52)        4      65199     31060     31151        0    0    0 01:47:13            7
spine03(swp53)        4      65199     31150     31207        0    0    0 01:48:31            7
spine04(swp54)        4      65199     31042     31098        0    0    0 01:46:57            7
leaf02(peerlink.4094) 4      65101     30919     30913        0    0    0 01:47:43           12

Total number of neighbors 5

要查看 BGP 定义的路由表,请运行 vtysh show ip bgp ipv4 unicast 命令。例如

cumulus@leaf01:~$ sudo vtysh
...
leaf01# show ip bgp ipv4 unicast
BGP table version is 88, local router ID is 10.10.10.1, vrf id 0
Default local pref 100, local AS 65101
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i10.0.1.1/32      peerlink.4094            0    100      0 ?
*>                  0.0.0.0                  0         32768 ?
*= 10.0.1.2/32      swp54                                  0 65199 65102 ?
*=                  swp52                                  0 65199 65102 ?
* i                 peerlink.4094                 100      0 65199 65102 ?
*=                  swp53                                  0 65199 65102 ?
*>                  swp51                                  0 65199 65102 ?
*= 10.0.1.254/32    swp54                                  0 65199 65132 ?
*=                  swp52                                  0 65199 65132 ?
* i                 peerlink.4094                 100      0 65199 65132 ?
*=                  swp53                                  0 65199 65132 ?
*>                  swp51                                  0 65199 65132 ?
*> 10.10.10.1/32    0.0.0.0                  0         32768 ?
*>i10.10.10.2/32    peerlink.4094            0    100      0 ?
*= 10.10.10.3/32    swp54                                  0 65199 65102 ?
*=                  swp52                                  0 65199 65102 ?
* i                 peerlink.4094                 100      0 65199 65102 ?
*=                  swp53                                  0 65199 65102 ?
*>                  swp51                                  0 65199 65102 ?
...

要显示特定邻居的更详细的细分信息,请运行 vtysh show ip bgp neighbor <neighbor> 命令或 NVUE nv show vrf <vrf> router bgp neighbor <neighbor> 命令

cumulus@switch:~$ nv show vrf default router bgp neighbor swp51
                               operational                applied   
-----------------------------  -------------------------  ----------
password                                                   *         
enforce-first-as                                           off       
passive-mode                                               off       
nexthop-connected-check                                    on        
description                                                none      
bfd                                                                  
  enable                                                   off       
ttl-security                                                                  
  enable                        on                         off       
  hops                          1                                    
local-as                                                             
  enable                                                   off       
timers                                                               
  keepalive                     3                          auto      
  hold                          9                          auto      
  connection-retry              10                         auto      
  route-advertisement           none                       auto      
address-family                                                       
  ipv4-unicast                                                       
    enable                                                 on        
    route-reflector-client                                 off       
    route-server-client                                    off       
    soft-reconfiguration                                   off       
    nexthop-setting                                        auto      
    add-path-tx                                            off       
    attribute-mod                                                    
      aspath                    off                        on        
      med                       off                        on        
      nexthop                   off                        on
...

显示 BGP 对等体信息

要显示有关所有 BGP 邻居的详细信息,请运行 nv show vrf <vrf> router bgp neighbor --view=detail -o json 命令

cumulus@leaf01:mgmt:~$ nv show vrf default router bgp neighbor --view=detail -o json
{
  "peerlink.4094": {
    "address-family": {
      "ipv4-unicast": {
        "attribute-mod": {
          "aspath": "off",
          "med": "off",
          "nexthop": "off"
        },
        "capabilities": {
          "rx-addpath": "on",
          "rx-graceful-restart": "on",
          "rx-mpbgp": "on",
          "rx-restart-f-bit": "off",
          "tx-addpath": "off",
          "tx-mpbgp": "on"
        },
        "community-advertise": {
          "extended": "on",
          "large": "on",
          "regular": "on"
        },
        "graceful-restart": {
          "rx-eof-rib": "on",
          "timers": {
            "stale-path": {
              "timer-sec": 360
            }
          },
          "tx-eof-rib": "on",
          "tx-eof-rib-sent-after-update": "off"
        },
        "prefix-limits": {
          "inbound": {
            "warning-only": "off"
          }
        },
        "rx-prefix": 10,
        "tx-prefix": 11,
        "update-group": 1
      },
      "l2vpn-evpn": {
        "attribute-mod": {
          "aspath": "off",
          "med": "off",
          "nexthop": "on"
        },
        "capabilities": {
          "rx-addpath": "on",
          "rx-graceful-restart": "on",
          "rx-mpbgp": "on",
          "rx-restart-f-bit": "off",
          "tx-addpath": "off",
          "tx-mpbgp": "on"
        },
        "graceful-restart": {
          "rx-eof-rib": "on",
          "timers": {
            "stale-path": {
              "timer-sec": 360
            }
          },
          "tx-eof-rib": "on",
          "tx-eof-rib-sent-after-update": "off"
        },
        "prefix-limits": {
          "inbound": {
            "warning-only": "off"
          }
        },
        "rx-prefix": 50,
        "tx-prefix": 70,
        "update-group": 2
      }
    },
    "bgp-version": 4,
    "capabilities": {
      "extended-nexthop": "on",
      "rx-asn32": "off",
      "rx-extended-nexthop": "off",
      "rx-graceful-restart": "on",
      "rx-restart-r-bit": "off",
      "rx-route-refresh": "on",
      "tx-asn32": "on",
      "tx-graceful-restart": "on",
      "tx-route-refresh": "on"
      ...

要查看所有 BGP 对等体的连接信息的摘要,例如状态(已建立、空闲)、正常运行时间、已接收和已发送的消息数以及连接建立的时间,请运行 nv show vrf <vrf> router bgp neighbor 命令。

cumulus@switch:~$ nv show vrf default router bgp neighbor

AS - Remote Autonomous System, PeerEstablishedTime - Peer established time in
UTC format, UpTime - Uptime in milliseconds, Afi-Safi - Address family, PfxSent
- Transmitted prefix counter, PfxRcvd - Recieved prefix counter

Neighbor       AS     State        PeerEstablishedTime   UpTime    MsgRcvd  MsgSent  Afi-Safi      PfxSent  PfxRcvd
-------------  -----  -----------  --------------------  --------  -------  -------  ------------  -------  -------
peerlink.4094  65102  established  2025-01-26T15:28:11Z  27073000  561127   473795   ipv4-unicast  11       10     
                                                                                     l2vpn-evpn    70       50     
swp51          65199  established  2025-01-26T15:28:16Z  27073000  548373   473791   ipv4-unicast  11       8      
                                                                                     l2vpn-evpn    70       50     
swp52          65199  established  2025-01-26T15:28:19Z  27073000  548377   473789   ipv4-unicast  11       8      
                                                                                     l2vpn-evpn    70       50     
swp53                 idle                               27073000  0        0        ipv4-unicast                  
                                                                                     l2vpn-evpn                    
swp54                 idle                               27073000  0        0        ipv4-unicast                  
                                                                                     l2vpn-evpn

运行 nv show vrf default router bgp neighbor -o json 命令以 json 格式显示所有 BGP 邻居的连接信息的摘要。

在 Cumulus Linux 5.11 及更早版本中,nv show vrf default router bgp neighbor -o json 命令输出显示有关 BGP 对等体的更多详细信息。要在 Cumulus Linux 5.12 及更高版本中显示更详细的 BGP 对等体信息,请运行上面显示的 nv show vrf <vrf> router bgp neighbor --view=detail -o json 命令。

检查 BGP 计时器设置

要检查 BGP 计时器,例如 BGP keepalive 间隔、保持时间和通告间隔,请运行 NVUE nv show vrf <vrf> router bgp neighbor <neighbor> timers 命令或 vtysh show ip bgp neighbor <peer> 命令。例如

cumulus@leaf01:~$ nv show vrf default router bgp neighbor swp51 timers
                     operational  applied
-------------------  -----------  -------
keepalive            3            auto   
hold                 9            auto   
connection-retry     10           auto   
route-advertisement  none         auto

BGP 更新组

您可以显示有关更新组事件的信息或有关特定 IPv4 或 IPv6 更新组的信息。

要显示有关更新组事件的信息,请运行 vtysh show bgp update-group 命令或运行以下 NVUE 命令

  • nv show vrf <vrf-id> router bgp address-family ipv4-unicast update-group 用于 IPv4
  • nv show vrf <vrf-id> router bgp address-family ipv6-unicast update-group 用于 IPv6
cumulus@leaf01:~$ nv show vrf default router bgp address-family ipv4-unicast update-group
RouteMap - Outbound route map, MinAdvInterval - Minimum route advertisement     
interval, CreationTime - Time when the update group was created, LocalAsChange -
LocalAs changes for inbound route, Flags - r - replace-as, x - no-prepend       

UpdateGrp  RouteMap  MinAdvInterval  CreationTime          LocalAsChange  Flags
---------  --------  --------------  --------------------  -------------  -----
1                    0               2024-07-08T18:00:57Z                      
3                    0               2024-07-09T20:48:11Z            

要显示有关特定更新组的信息,例如对等体刷新事件数、剪枝事件数和数据包队列长度,请运行 vtysh show bgp update-group <group-id> 命令或运行以下 NVUE 命令

  • nv show vrf <vrf-id> router bgp address-family ipv4-unicast update-group <group-id> -o json 用于 IPv4
  • nv show vrf <vrf-id> router bgp address-family ipv6-unicast update-group <group-id> -o json 用于 IPv6
cumulus@leaf01:~$ nv show vrf default router bgp address-family ipv4-unicast update-group 1 -o json
{
  "create-time": "2024-10-25T14:02:24Z",
  "min-route-advertisement-interval": 0,
  "sub-group": {
    "1": {
      "adjacency-count": 13,
      "coalesce-time": 1300,
      "counters": {
        "join-events": 5,
        "merge-check-events": 0,
        "merge-events": 3,
        "peer-refresh-events": 0,
        "prune-events": 0,
        "split-events": 0,
        "switch-events": 0
      },
      "create-time": "2024-10-25T14:02:24Z",
      "needs-refresh": "off",
      "neighbor": {
        "peerlink.4094": {},
        "swp51": {},
        "swp52": {},
        "swp53": {},
        "swp54": {}
      },
      "packet-counters": {
        "queue-hwm-len": 2,
        "queue-len": 0,
        "queue-total": 14,
        "total-enqueued": 14
      },
      "sub-group-id": 1,
      "version": 18
    }
  },
  "update-group-id": "1"
}

显示 BGP 路由信息

您可以运行 NVUE 命令来显示 BGP 邻居的路由统计信息,例如路由数,以及有关通告和接收路由的信息。

要显示 IPv4 路由的路由表,请运行 nv show vrf <vrf> router rib ipv4 route 命令。要显示 IPv6 路由的 RIB 表,请运行 nv show vrf <vrf> router rib ipv6 route 命令。

cumulus@leaf01:mgmt:~$ nv show vrf default router rib ipv4 route
                                                                                
Flags - * - selected, q - queued, o - offloaded, i - installed, S - fib-        
selected, x - failed                                                            
                                                                                
Route            Protocol   Distance  Uptime                NHGId  Metric  Flags
---------------  ---------  --------  --------------------  -----  ------  -----
10.1.10.0/24     connected  0         2024-07-18T21:57:29Z  46     0       *Sio 
10.1.20.0/24     connected  0         2024-07-18T21:57:29Z  47     0       *Sio 
10.1.30.0/24     connected  0         2024-07-18T21:57:29Z  48     0       *Sio 
10.1.40.0/24     bgp        20        2024-07-18T22:02:22Z  57     0       *Si  
10.1.50.0/24     bgp        20        2024-07-18T22:02:22Z  57     0       *Si  
10.1.60.0/24     bgp        20        2024-07-18T22:02:22Z  57     0       *Si  
10.10.10.1/32    connected  0         2024-07-18T21:55:54Z  7      0       *Sio 
10.10.10.2/32    bgp        20        2024-07-18T21:57:29Z  34     0       *Si  
10.10.10.3/32    bgp        20        2024-07-18T22:02:22Z  57     0       *Si  
10.10.10.4/32    bgp        20        2024-07-18T22:02:27Z  57     0       *Si  
10.10.10.101/32  bgp        20        2024-07-18T22:01:14Z  50     0       *Si  
10.10.10.102/32  bgp        20        2024-07-18T22:02:22Z  58     0       *Si

要显示本地路由表中的路由,请为 IPv4 运行 nv show vrf <vrf> router bgp address-family ipv4-unicast route 命令,为 IPv6 运行 nv show vrf <vrf> router bgp address-family ipv6-unicast route 命令。您还可以运行带有 -o json 的命令以 json 格式显示接收到的路由。

cumulus@leaf02:~$ nv show vrf default router bgp address-family ipv4-unicast route                                            PathCount - Number of paths present for the prefix, MultipathCount - Number of  
paths that are part of the ECMP, DestFlags - * - bestpath-exists, w - fib-wait- 
for-install, s - fib-suppress, i - fib-installed, x - fib-install-failed        
                                                                                
Prefix           PathCount  MultipathCount  DestFlags
---------------  ---------  --------------  ---------
10.0.1.12/32     2          1               *        
10.0.1.34/32     5          4               *        
10.0.1.255/32    5          4               *        
10.10.10.1/32    1          1               *        
10.10.10.2/32    5          1               *        
10.10.10.3/32    5          4               *        
10.10.10.4/32    5          4               *        
10.10.10.63/32   5          4               *        
10.10.10.64/32   5          4               *        
10.10.10.101/32  2          1               *        
10.10.10.102/32  2          1               *        
10.10.10.103/32  2          1               *        
10.10.10.104/32  2          1               * 

要显示有关本地路由表中的特定路由的信息,请为 IPv4 运行 nv show vrf <vrf> router bgp address-family ipv4-unicast route <route> 命令,为 IPv6 运行 nv show vrf <vrf> router bgp address-family ipv6-unicast route <route> 命令。

上述 IPv4 和 IPv6 命令以简要格式显示本地路由表路由信息,以提高高规模环境的性能。您还可以运行带有 -o json 的命令以 json 格式显示接收到的路由。

cumulus@leaf01:~$ nv show vrf default router bgp address-family ipv4-unicast route 10.10.10.64/32
                 operational
---------------  -----------
path-count       5          
multipath-count  4

path
=======                                                                           
    Origin - Route origin, Local - Locally originated route, Sourced - Sourced      
    route, Weight - Route weight, Metric - Route metric, LocalPref - Route local    
    preference, PathFrom - Route path origin, LastUpdate - Route last update,       
    NexthopCnt - Number of nexthops, Flags - = - multipath, * - bestpath, v - valid,
    s - suppressed, R - removed, S - stale                                          
                                                                                
    Path  Origin      Local  Sourced  Weight  Metric  LocalPref  PathFrom  LastUpdate            NexthopCnt  Flags
    ----  ----------  -----  -------  ------  ------  ---------  --------  --------------------  ----------  -----
    1     incomplete                                             external  2024-10-25T14:02:33Z  2           =*v  
    2     incomplete                                             external  2024-10-25T14:02:42Z  2           =v   
    3     incomplete                                             external  2024-10-25T14:02:36Z  2           =v   
    4     incomplete                                             external  2024-10-25T14:02:36Z  2           =v   
    5     incomplete                                             external  2024-10-25T14:02:33Z  2           *v   
advertised-to
================
    Neighbor       hostname
    -------------  --------
    peerlink.4094  leaf02  
    swp51          spine01 
    swp52          spine02 
    swp53          spine03 
    swp54          spine04

要显示路由计数,请为 IPv4 运行 nv show vrf <vrf-id> router bgp neighbor <neighbor-id> address-family ipv4-unicast route-counters 命令,为 IPv6 运行 nv show vrf <vrf-id> router bgp neighbor <neighbor-id> address-family ipv6-unicast route-counters 命令。

cumulus@leaf01:~$ nv show vrf default router bgp neighbor swp51 address-family ipv4-unicast route-counters
                operational
--------------  -----------
route-count     8          
adj-rib-in      0          
damped          0          
removed         0          
history         0          
stale           0          
valid           8          
all-rib         8          
routes-counted  8          
best-routes     7          
usable          8 

要显示所有通告的路由,请为 IPv4 运行 nv show vrf <vrf> router bgp neighbor <neighbor> address-family ipv4-unicast advertised-routes 命令,为 IPv6 运行 nv show vrf <vrf>> router bgp neighbor <neighbor> address-family ipv6-unicast advertised-routes 命令。

上述 IPv4 和 IPv6 命令以简要格式显示通告的路由,以提高高规模环境的性能。您还可以运行带有 -o json 的命令以 json 格式显示接收到的路由。

cumulus@leaf01:~$ nv show vrf default router bgp neighbor swp51 address-family ipv4-unicast advertised-routes 
PathCount - Number of paths present for the prefix, MultipathCount - Number of  
paths that are part of the ECMP                                                 
                                                                                
IPv4 Prefix      PathCount  MultipathCount  DestFlags      
---------------  ---------  --------------  ---------------
10.1.10.0/24     3          1               bestpath-exists
10.1.20.0/24     3          1               bestpath-exists
10.1.30.0/24     3          1               bestpath-exists
10.1.40.0/24     3          2               bestpath-exists
10.1.50.0/24     3          2               bestpath-exists
10.1.60.0/24     3          2               bestpath-exists
10.10.10.1/32    2          1               bestpath-exists
10.10.10.2/32    3          1               bestpath-exists
10.10.10.3/32    3          2               bestpath-exists
10.10.10.4/32    3          2               bestpath-exists
10.10.10.101/32  2          1               bestpath-exists
10.10.10.102/32  2          1               bestpath-exists

要显示有关特定通告路由的信息,请为 IPv4 运行 nv show <vrf> default router bgp neighbor <neighbor> address-family ipv4-unicast advertised-routes <route> 命令,为 IPv6 运行 nv show <vrf> default router bgp neighbor <neighbor> address-family ipv6-unicast advertised-routes <route> 命令。

cumulus@leaf01:~$ nv show vrf default router bgp neighbor swp51 address-family ipv4-unicast advertised-route 10.10.10.1/32
                 operational
---------------  -----------
path-count       2          
multipath-count  1
path
====================
                                                                                
    Origin - Route origin, Local - Locally originated route, Sourced - Sourced      
    route, Weight - Route weight, Metric - Route metric, LocalPref - Route local    
    preference, PathFrom - Route path origin, LastUpdate - Route last update,       
    NexthopCnt - Number of nexthops, Flags - = - multipath, * - bestpath, v - valid,
    s - suppressed, R - removed, S - stale                                          
                                                                                
    Path  Origin      Local  Sourced  Weight  Metric  LocalPref  PathFrom  LastUpdate            NexthopCnt  Flags
    ----  ----------  -----  -------  ------  ------  ---------  --------  --------------------  ----------  -----
    1     IGP         on     on       32768   0                            2024-07-18T21:55:54Z  1           *v   
    2     incomplete         on       32768   0                            2024-07-18T21:55:54Z  1           v 
...

要显示所有接收到的路由,请为 IPv4 运行 nv show vrf <vrf> router bgp neighbor <neighbor> address-family ipv4-unicast received-routes 命令,为 IPv6 运行 nv show vrf <vrf> router bgp neighbor <neighbor> address-family ipv6-unicast received-routes 命令。这些命令以简要格式显示接收到的路由,以提高高规模环境的性能。您还可以运行带有 --view=detail 的命令以查看更详细的信息,或带有 -o json 的命令以 json 格式显示接收到的路由。

要显示有关特定接收路由的信息,请为 IPv4 运行 nv show vrf <vrf> router bgp neighbor <neighbor> address-family ipv4-unicast received-routes <route> -o json 命令,为 IPv6 运行 nv show vrf <vrf> router bgp neighbor <neighbor> address-family ipv6-unicast received-routes <route> -o json 命令。

显示下一跳信息

要显示所有 BGP IPv4 或 IPv6 下一跳的摘要,请运行 nv show vrf <vrf> router bgp nexthop ipv4nv show vrf <vrf> router bgp nexthop ipv6 命令。输出显示 IGP 指标、指向下一跳的路径数以及用于到达下一跳的地址或接口。

cumulus@leaf01:mgmt:~$ nv show vrf default router bgp nexthop ipv4
Nexthops
===========
                                                                                 
    PathCnt - Number of paths pointing to this Nexthop, ResolvedVia - Resolved via   
    address or interface, Interface - Resolved via interface                         
                                                                                 
    Address      IGPMetric  Valid  PathCnt  ResolvedVia                Interface    
    -----------  ---------  -----  -------  -------------------------  -------------
    10.0.1.34    0          on     160      fe80::4ab0:2dff:fe60:910e  swp54        
                                            fe80::4ab0:2dff:fea7:7852  swp53        
                                            fe80::4ab0:2dff:fec8:8fb9  swp52        
                                            fe80::4ab0:2dff:feff:e147  swp51        
    10.10.10.2   0          on     15       fe80::4ab0:2dff:fe2d:495c  peerlink.4094
    10.10.10.3   0          on     15       fe80::4ab0:2dff:fe60:910e  swp54        
                                            fe80::4ab0:2dff:fea7:7852  swp53        
                                            fe80::4ab0:2dff:fec8:8fb9  swp52        
                                            fe80::4ab0:2dff:feff:e147  swp51        
    10.10.10.4   0          on     15       fe80::4ab0:2dff:fe60:910e  swp54        
                                            fe80::4ab0:2dff:fea7:7852  swp53        
                                            fe80::4ab0:2dff:fec8:8fb9  swp52        
                                            fe80::4ab0:2dff:feff:e147  swp51        
    10.10.10.63  0          on     15       fe80::4ab0:2dff:fe60:910e  swp54        
                                            fe80::4ab0:2dff:fea7:7852  swp53        
                                            fe80::4ab0:2dff:fec8:8fb9  swp52        
                                            fe80::4ab0:2dff:feff:e147  swp51        
    10.10.10.64  0          on     15       fe80::4ab0:2dff:fe60:910e  swp54        
                                            fe80::4ab0:2dff:fea7:7852  swp53        
                                            fe80::4ab0:2dff:fec8:8fb9  swp52        
                                            fe80::4ab0:2dff:feff:e147  swp51    

要显示有关特定下一跳的信息,请为 IPv4 运行 vtysh NVUE nv show vrf <vrf-id> router bgp nexthop ipv4 ip-address <ip-address> 命令,为 IPv6 运行 nv show vrf <vrf-id> router bgp nexthop ipv6 ip-address <ip-address> 命令。您还可以运行 vtysh show bgp vrf default nexthop <ip-address> 命令。

cumulus@leaf01:mgmt:~$  nv show vrf default router bgp nexthop ipv4 ip-address 10.10.10.2
                  operational              
----------------  -------------------------
valid             yes                      
complete          on                       
igp-metric        0                        
path-count        15                       
last-update-time  2024-10-25T14:02:32Z     
[resolved-via]    fe80::4ab0:2dff:fee8:57ba

要显示 BGP 通过哪个地址和接口解析特定下一跳,请为 IPv4 运行 nv show vrf <vrf-id> router bgp nexthop ipv4 ip-address <ip-address-id> resolved-via 命令,为 IPv6 运行 nv show vrf <vrf-id> router bgp nexthop ipv6 ip-address <ip-address-id> resolved-via 命令。

cumulus@leaf01:~$ nv show vrf default router bgp nexthop ipv4 ip-address 10.10.10.2 resolved-via
Nexthop                    interface
-------------------------  ---------
fe80::4ab0:2dff:fe20:ac25  swp51    
fe80::4ab0:2dff:fe93:d92d  swp52

显示前缀无关收敛信息

当您启用 BGP 前缀无关收敛 (PIC) 时,您可以使用以下命令来显示有关路由源扩展社区 (SOO) 路由和路由的 SOO 对等体位索引映射的信息。

要显示有关所有路由源扩展社区 (SOO) 路由的信息,请运行 nv show <vrf> default router bgp address-family <address-family> soo-route 命令

cumulus@spine01:~$ nv show vrf default router bgp address-family ipv4-unicast soo-route 

PathCnt - Number of paths for this SoO., RouteCnt - Number of routes with this
SoO, SoONhgID - Nexthop group id used by this SoO, SoORouteFlag - Indicates
Site-of-Origin route flag - I - Installed, NhgRouteCnt - Number of routes using
SoO NHG, NhgFlag - V - valid, Ip - install-pending, Dp - delete-pending

SoORouteID  PathCnt  RouteCnt  SoONhgID  SoORouteFlag  NhgRouteCnt  NhgFlag
----------  -------  --------  --------  ------------  -----------  -------
10.10.10.1  1        1         70328885  I             1            V  

要显示有关特定 SOO 路由的信息,请运行 nv show <vrf> default router bgp address-family <address-family> soo-route 命令

cumulus@spine01:~$ nv show vrf default router bgp address-family ipv4-unicast soo-route 10.10.10.1
                          operational              
------------------------  -------------------------
num-paths                 1                        
nexthop-group-id          70328885                 
num-routes-with-soo       1                        
num-routes-using-soo-nhg  1                        
soo-route-flag            I                        
nhg-flags-string          V                        
nhg-flags                                          
  nhg-valid               yes                      
  nhg-install-pending     no                       
  nhg-delete-pending      no                       
[peer-index]              fe80::4ab0:2dff:fe3a:a928
bit-map                                            
  selected-path-bitmap     1                       
  installed-path-bitmap    1                       
[route-with-soo]          10.0.1.12/32

要显示 SOO 路由的 SOO 对等体位索引映射,请运行 nv show <vrf> default router bgp address-family <address-family> soo-route <prefix> peer-index 命令

cumulus@spine01:~$ nv show vrf default router bgp address-family ipv4-unicast soo-route 10.10.10.1 peer-index
SooPeerBitIndex - Indicates Site-of-Origin peer bit index mapping

IPAddress                  SooPeerBitIndex
-------------------------  ---------------
fe80::4ab0:2dff:fe3a:a928  1

要显示特定路由是否使用 PIC,请运行 nv show <vrf> default router bgp address-family <address-family> soo-route <prefix> route-with-soo 命令

cumulus@spine01:~$ nv show vrf default router bgp address-family ipv4-unicast soo-route 10.10.10.1 route-with-soo 
UseSooNhg - Indicates this route-with-soo uses SooNhg, SelectedPathBitmap -
Details of Site-of-Origin selected path bitmap

Prefix        UseSooNhg  SelectedPathBitmap
------------  ---------  ------------------
10.0.1.12/32  yes         1

要显示有关所有 SOO 路由的信息,请运行 show bgp vrf <vrf> <address-family> unicast soo route 命令

cumulus@leaf01:~$ sudo vtysh
...
leaf01# show bgp vrf default ipv4 unicast soo route
BGP: VRF default

SoO: 10.10.10.1
  NHG:
    NHG ID: 70328887
    NHG flags: Valid, Installed
  SoO route:
    Number of paths: 1
    Number of Routes with SoO: 1
    Number of Routes with SoO using SoO NHG: 1
    SoO route flags: Installed
  Nexthop cache:
      fe80::4ab0:2dff:feec:f8e/128 NH ifidx: 3 type: 5 flags: 5 lbw: 0
  Peer BitIndex Mappings:
    fe80::4ab0:2dff:feec:f8e: 1
  Bitmaps:
    Selected path info bitmap  bits set: 1
    Installed path info bitmap bits set: 1
  Route with SoO:
      10.0.1.12/32 uses SoO NHG Selected path info bitmap bits set: 1
SoO: 10.10.10.3
  NHG:
    NHG ID: 70328889
    NHG flags: Valid, Installed
  SoO route:
    Number of paths: 1
    Number of Routes with SoO: 1
    Number of Routes with SoO using SoO NHG: 1
    SoO route flags: Installed
  Nexthop cache:
      fe80::4ab0:2dff:fef2:6bc5/128 NH ifidx: 5 type: 5 flags: 5 lbw: 0
  Peer BitIndex Mappings:
    fe80::4ab0:2dff:fef2:6bc5: 3
  Bitmaps:
    Selected path info bitmap  bits set: 3
    Installed path info bitmap bits set: 3
  Route with SoO:
      10.0.1.34/32 uses SoO NHG Selected path info bitmap bits set: 3
SoO: 10.10.10.2
  NHG:
    NHG ID: 70328888
    NHG flags: Valid, Installed
  SoO route:
    Number of paths: 1
    Number of Routes with SoO: 1
    Number of Routes with SoO using SoO NHG: 0
    SoO route flags: Installed
  Nexthop cache:
      fe80::4ab0:2dff:fe5d:6456/128 NH ifidx: 4 type: 5 flags: 5 lbw: 0
  Peer BitIndex Mappings:
    fe80::4ab0:2dff:fe5d:6456: 2
  Bitmaps:
    Selected path info bitmap  bits set: 2
    Installed path info bitmap bits set: 2
  Route with SoO:
      10.0.1.12/32 Selected path info bitmap bits set: 2

要显示有关特定 SOO 路由的信息,请运行 show bgp vrf <vrf> <address-family> unicast soo route <prefix> 命令

cumulus@spine01:~$ sudo vtysh
...
spine01# show bgp vrf default ipv4 unicast soo route 10.10.10.3
BGP: VRF default

SoO: 10.10.10.3
  NHG:
    NHG ID: 70328889
    NHG flags: Valid, Installed
  SoO route:
    Number of paths: 1
    Number of Routes with SoO: 1
    Number of Routes with SoO using SoO NHG: 1
    SoO route flags: Installed
  Nexthop cache:
      fe80::4ab0:2dff:fef2:6bc5/128 NH ifidx: 5 type: 5 flags: 5 lbw: 0
  Peer BitIndex Mappings:
    fe80::4ab0:2dff:fef2:6bc5: 3
  Bitmaps:
    Selected path info bitmap  bits set: 3
    Installed path info bitmap bits set: 3
  Route with SoO:
      10.0.1.34/32 uses SoO NHG Selected path info bitmap bits set: 3

您可以以 json 格式显示上述命令。例如

cumulus@spine01:~$ sudo vtysh
...
spine01# show bgp vrf default ipv4 unicast soo route json 
{
  "default":[
    {
      "SoORoute":"10.10.10.1",
      "numPaths":1,
      "nexthopgroupId":70328887,
      "numRoutesWithSoO":1,
      "numRoutesWithSoOUsingSoONHG":1,
      "nhgValid":true,
      "nhgInstallPending":false,
      "nhgDeletePending":false,
      "SoORouteFlag":"Installed",
      "nextHopCache":[
        {
          "prefix":"fe80::4ab0:2dff:feec:f8e/128",
          "ifIndex":3,
          "type":5,
          "flags":5,
          "lbw":0
        }
      ],
      "peerBitIndexMapping":[
        {
          "peerIp":"fe80::4ab0:2dff:feec:f8e",
          "bitIndex":1
        }
      ],
      "bitMaps":[
        {
          "selectedPathBitmap":" 1",
          "installedPathBitmap":" 1"
        }
      ],
      "routeWithSoO":[
        {
          "prefix":"10.0.1.12/32",
          "usesSoONhg":true,
          "selectedPathBitmap":" 1"
        }
      ]
    },
    {
      "SoORoute":"10.10.10.3",
      "numPaths":1,
      "nexthopgroupId":70328889,
      "numRoutesWithSoO":1,
      "numRoutesWithSoOUsingSoONHG":1,
      "nhgValid":true,
      "nhgInstallPending":false,
      "nhgDeletePending":false,
      "SoORouteFlag":"Installed",
      "nextHopCache":[
        {
          "prefix":"fe80::4ab0:2dff:fef2:6bc5/128",
          "ifIndex":5,
          "type":5,
          "flags":5,
          "lbw":0
        }
      ],
      "peerBitIndexMapping":[
        {
          "peerIp":"fe80::4ab0:2dff:fef2:6bc5",
          "bitIndex":3
        }
      ],
      "bitMaps":[
        {
          "selectedPathBitmap":" 3",
          "installedPathBitmap":" 3"
        }
      ],
      "routeWithSoO":[
        {
          "prefix":"10.0.1.34/32",
          "usesSoONhg":true,
          "selectedPathBitmap":" 3"
        }
      ]
    },
    {
      "SoORoute":"10.10.10.2",
      "numPaths":1,
      "nexthopgroupId":70328888,
      "numRoutesWithSoO":1,
      "numRoutesWithSoOUsingSoONHG":0,
      "nhgValid":true,
      "nhgInstallPending":false,
      "nhgDeletePending":false,
      "SoORouteFlag":"Installed",
      "nextHopCache":[
        {
          "prefix":"fe80::4ab0:2dff:fe5d:6456/128",
          "ifIndex":4,
          "type":5,
          "flags":5,
          "lbw":0
        }
      ],
      "peerBitIndexMapping":[
        {
          "peerIp":"fe80::4ab0:2dff:fe5d:6456",
          "bitIndex":2
        }
      ],
      "bitMaps":[
        {
          "selectedPathBitmap":" 2",
          "installedPathBitmap":" 2"
        }
      ],
      "routeWithSoO":[
        {
          "prefix":"10.0.1.12/32",
          "usesSoONhg":false,
          "selectedPathBitmap":" 2"
        }
      ]
    }
  ]
}

show bgp <address-family> unicastshow bgp <address-family> unicast <prefix> 命令也显示 SOO 信息

cumulus@spine01:~$ sudo vtysh
...
spine01# show bgp ipv4 unicast 10.10.10.3
BGP routing table entry for 10.10.10.3/32, version 29 SoO:10.10.10.3, multipath soo nhg:70328889
Paths: (2 available, best #1, table default)
  Advertised to non peer-group peers:
  leaf01(swp1) leaf02(swp2) leaf03(swp3) leaf04(swp4) border01(swp5) border02(swp6)
  65103
    fe80::4ab0:2dff:fef2:6bc5 (leaf03) from leaf03(swp3) (10.10.10.3)
    (fe80::4ab0:2dff:fef2:6bc5) (used)
      Origin IGP, metric 0, valid, external, bestpath-from-AS 65103, best (AS Path)
      Extended Community: SoO:10.10.10.3:0
      Last update: Wed Jan 22 20:12:46 2025
  65104 65103
    fe80::4ab0:2dff:feab:57dd (leaf04) from leaf04(swp4) (10.10.10.4)
    (fe80::4ab0:2dff:feab:57dd) (used)
      Origin IGP, valid, external, bestpath-from-AS 65104
      Extended Community: SoO:10.10.10.3:0
      Last update: Wed Jan 22 20:12:46 2025

排除 BGP Unnumbered 故障

要验证 FRR 是否通过给定接口上的 IPv6 邻居发现路由器通告学习邻居链路本地 IPv6 地址,请运行 vtysh show interface <interface> 命令。

如果您没有在接口的两端都启用 ipv6 nd suppress-ra,则 Neighbor address(s): 会显示另一端的链路本地地址(BGP 在该接口使用 BGP 时使用的地址)。

Cumulus Linux 会自动在具有 IPv6 地址的接口上启用 IPv6 路由通告 (RA)。您无需为 BGP Unnumbered 运行 no ipv6 nd suppress-ra 命令。

cumulus@switch:~$ sudo vtysh
...
switch# show interface swp51
  Interface swp51 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  PTM status: disabled
  vrf: default
  OS Description: leaf to spine
  index 8 metric 0 mtu 9216 speed 1000
  flags: <UP,BROADCAST,RUNNING,MULTICAST>
  Type: Ethernet
  HWaddr: 10:d8:68:d4:a6:81
  inet6 fe80::12d8:68ff:fed4:a681/6
  Interface Type Other
  protodown: off
  ND advertised reachable time is 0 milliseconds
  ND advertised retransmit interval is 0 milliseconds
  ND advertised hop-count limit is 64 hops
  ND router advertisements sent: 217 rcvd: 216
  ND router advertisements are sent every 10 seconds
  ND router advertisements lifetime tracks ra-interval
  ND router advertisement default router preference is medium
  Hosts use stateless autoconfig for addresses.
  Neighbor address(s):
  inet6 fe80::f208:5fff:fe12:cc8c/128

排除使用 IPv6 下一跳学习的 IPv4 前缀的故障

要显示使用 IPv6 下一跳学习的 IPv4 前缀,请运行以下命令。

以下示例显示了从 BGP 对等体通过使用 IPv6 全局地址的 IPv6 会话学习的 IPv4 前缀,但 BGP 安装的下一跳是链路本地 IPv6 地址。当会话直接在对等体之间时,并且前缀的 BGP 更新同时包含链路本地和全局 IPv6 地址时,会发生这种情况。如果全局和链路本地下一跳都存在,则 BGP 优先使用链路本地地址进行路由安装。

cumulus@spine01:mgmt:~$ sudo vtysh
...
spine01# show ip bgp ipv4 unicast summary
BGP router identifier 10.10.10.101, local AS number 65199 vrf-id 0
BGP table version 3
RIB entries 3, using 576 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor                   V      AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
leaf01(2001:db8:2::a00:1) 4     65101       22        22        0    0    0  00:01:00           0

Total number of neighbors 1
cumulus@spine01:mgmt:~$ sudo vtysh
...
spine01# show ip bgp ipv4 unicast
BGP table version is 3, local router ID is 10.10.10.101, vrf id 0
Default local pref 100, local AS 65199
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop                Metric LocPrf Weight Path
   10.10.10.101/32   fe80::a00:27ff:fea6:b9fe      0     0   32768 i

Displayed  1 routes and 1 total paths
cumulus@spine01:~$ sudo vtysh
...
spine01# show ip bgp ipv4 unicast 10.10.10.101/32
BGP routing table entry for 10.10.10.101/32
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  Leaf01(2001:db8:0002::0a00:1)
  3
    2001:db8:0002::0a00:1 from Leaf01(2001:db8:0002::0a00:1) (10.10.10.101)
    (fe80::a00:27ff:fea6:b9fe) (used)
      Origin IGP, metric 0, valid, external, bestpath-from-AS 3, best (First path received)
      AddPath ID: RX 0, TX 3
      Last update: Mon Oct 22 08:09:22 2018

以下示例输出显示了在 FRR RIB 以及内核 FIB 中安装路由的结果。在 FRR RIB 中安装的下一跳是链路本地 IPv6 地址,Cumulus Linux 会将其转换为 IPv4 链路本地地址,这是内核 FIB 安装所必需的。

cumulus@spine01:~$ sudo vtysh
...
spine01# show ip route 10.10.10.101/32
RIB entry for 10.10.10.101/32
===========================
Routing entry for 10.10.10.101/32
  Known via "bgp", distance 20, metric 0, best
  Last update 2d17h05m ago
  * fe80::a00:27ff:fea6:b9fe, via swp1

FIB entry for 10.10.10.101/32
===========================
10.10.10.101/32 via 10.0.1.0 dev swp1 proto bgp metric 20 onlink

如果 BGP 仅使用 IPv6 全局下一跳地址(当它通过路由反射器学习路由时)学习 IPv4 前缀,则命令输出会将 IPv6 全局地址显示为下一跳值。该命令还显示它通过路由反射器的链路本地地址递归学习。当您使用全局 IPv6 地址作为 FRR RIB 中路由安装的下一跳时,交换机仍会将其转换为 IPv4 链路本地地址以安装到内核中。

cumulus@leaf01:~$ sudo vtysh
...
leaf01# show ip bgp ipv4 unicast summary
BGP router identifier 10.10.10.1, local AS number 65101 vrf-id 0
BGP table version 1
RIB entries 1, using 152 bytes of memory
Peers 1, using 19 KiB of memory

Neighbor             V AS MsgRcvd  MsgSent  TblVer  InQ  OutQ  Up/Down  State/PfxRcd
Spine01(2001:db8:0002::0a00:2) 4 1   74       68         0     0     0     00:00:45      1

Total number of neighbors 1
cumulus@leaf01:~$ sudo vtysh
...
leaf01# show ip bgp ipv4 unicast summary
  BGP table version is 1, local router ID is 10.10.10.1
  Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
                i internal, r RIB-failure, S Stale, R Removed
  Origin codes: i - IGP, e - EGP, ? - incomplete

Network          Next Hop    Metric LocPrf Weight Path
*>i10.1.10.0/24 2001:2:2::4       0    100      0    i

Displayed 1 routes and 1 total paths
cumulus@leaf01:~$ sudo vtysh
...
leaf01# show ip bgp ipv4 unicast 10.10.10.101/32
BGP routing table entry for 10.10.10.101/32
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  Local
  2001:2:2::4 from Spine01(2001:1:1::1) (10.10.10.104)
    Origin IGP, metric 0, localpref 100, valid, internal, bestpath-from-AS Local, best (First path received)
    Originator: 10.0.0.14, Cluster list: 10.10.10.111
    AddPath ID: RX 0, TX 5
    Last update: Mon Oct 22 14:25:30 2018
cumulus@leaf01:~$ sudo vtysh
...
leaf01# show ip route 10.10.10.1/32
RIB entry for 10.10.10.1/32
===========================
Routing entry for 10.10.10.1/32
  Known via "bgp", distance 200, metric 0, best
  Last update 00:01:13 ago
  2001:2:2::4 (recursive)
  * fe80::a00:27ff:fe5a:84ae, via swp1

FIB entry for 10.10.10.1/32
===========================
10.10.10.1/32 via 10.0.1.1 dev swp1 proto bgp metric 20 onlink

要仅使用 IPv6 全局地址进行路由安装到 FRR RIB 中,您必须在相应地址族中的邻居或对等组语句中添加额外的路由映射。当路由映射命令 set ipv6 next-hop prefer-global 应用于邻居时,如果前缀的 BGP 更新中同时存在链路本地和全局 IPv6 地址,则 BGP 使用 IPv6 全局地址进行路由安装。

通过此附加配置,直接邻居情况下的 FRR RIB 中的输出会如下所示更改

router bgp 65101
  bgp router-id 10.10.10.1
  neighbor 2001:db8:2::a00:1 remote-as internal
  neighbor 2001:db8:2::a00:1 capability extended-nexthop
  !
  address-family ipv4 unicast
  neighbor 2001:db8:2::a00:1 route-map GLOBAL in
  exit-address-family
!
route-map GLOBAL permit 20
  set ipv6 next-hop prefer-global
!

生成的 FRR RIB 输出如下

cumulus@leaf01:~$ sudo vtysh
...
leaf01# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
    O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
    T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
    F - PBR,
    > - selected route, * - FIB route

B 0.0.0.0/0 [200/0] via 2001:2:2::4, swp2, 00:01:00
K 0.0.0.0/0 [0/0] via 10.0.2.2, eth0, 1d02h29m
C>* 10.0.0.9/32 is directly connected, lo, 5d18h32m
C>* 10.0.2.0/24 is directly connected, eth0, 03:51:31
B>* 172.16.4.0/24 [200/0] via 2001:2:2::4, swp2, 00:01:00ß
C>* 172.16.10.0/24 is directly connected, swp3, 5d18h32m

当交换机通过路由反射器学习路由时,它看起来像这样

router bgp 65101
  bgp router-id 10.10.10.1
  neighbor 2001:db8:2::a00:2 remote-as internal
  neighbor 2001:db8:2::a00:2 capability extended-nexthop
  !
  address-family ipv6 unicast
  neighbor 2001:db8:2::a00:2 activate
  neighbor 2001:db8:2::a00:2 route-map GLOBAL in
  exit-address-family
!
route-map GLOBAL permit 10
  set ipv6 next-hop prefer-global
cumulus@leaf01:~$ sudo vtysh
...
leaf01# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR,
       > - selected route, * - FIB route

B   0.0.0.0/0 [200/0] via 2001:2:2::4, 00:00:01
K   0.0.0.0/0 [0/0] via 10.0.2.2, eth0, 3d00h26m
C>* 10.0.0.8/32 is directly connected, lo, 3d00h26m
C>* 10.0.2.0/24 is directly connected, eth0, 03:39:18
C>* 172.16.3.0/24 is directly connected, swp2, 3d00h26m
B>  172.16.4.0/24 [200/0] via 2001:2:2::4 (recursive), 00:00:01
  *                         via 2001:1:1::1, swp1, 00:00:01
C>* 172.16.10.0/24 is directly connected, swp3, 3d00h26m

邻居状态更改日志

Cumulus Linux 在 syslog/var/log/frr/frr.log 文件中记录邻居经历的更改。例如

020-10-05T15:51:32.621773-07:00 leaf01 bgpd[10104]: %NOTIFICATION: sent to neighbor peerlink.4094 6/7 (Cease/Connection collision resolution) 0 bytes
2020-10-05T15:51:32.623023-07:00 leaf01 bgpd[10104]: %ADJCHANGE: neighbor peerlink.4094(leaf02) in vrf default Up
2020-10-05T15:51:32.623156-07:00 leaf01 bgpd[10104]: %NOTIFICATION: sent to neighbor peerlink.4094 6/7 (Cease/Connection collision resolution) 0 bytes
2020-10-05T15:51:32.623496-07:00 leaf01 bgpd[10104]: %ADJCHANGE: neighbor peerlink.4094(leaf02) in vrf default Down No AFI/SAFI activated for peer
2020-10-05T15:51:33.040332-07:00 leaf01 bgpd[10104]: [EC 33554454] swp53 [Error] bgp_read_packet error: Connection reset by peer
2020-10-05T15:51:33.279468-07:00 leaf01 bgpd[10104]: [EC 33554454] swp52 [Error] bgp_read_packet error: Connection reset by peer
2020-10-05T15:51:33.339487-07:00 leaf01 bgpd[10104]: %ADJCHANGE: neighbor swp54(spine04) in vrf default Up
2020-10-05T15:51:33.340893-07:00 leaf01 bgpd[10104]: %ADJCHANGE: neighbor swp53(spine03) in vrf default Up
2020-10-05T15:51:33.341648-07:00 leaf01 bgpd[10104]: %ADJCHANGE: neighbor swp52(spine02) in vrf default Up
2020-10-05T15:51:33.342369-07:00 leaf01 bgpd[10104]: %ADJCHANGE: neighbor swp51(spine01) in vrf default Up
2020-10-05T15:51:33.627958-07:00 leaf01 bgpd[10104]: %ADJCHANGE: neighbor peerlink.4094(leaf02) in vrf default Up

清除 BGP 路由

NVUE 提供了清除和刷新 BGP 表中路由的命令。您可以清除 BGP 表中的所有路由或 VRF 中地址族(IPv4、IPv6 或 EVPN)的所有路由。

BGP clear 命令不会清除内核或硬件中的计数器。

  • 指定方向(inout)的 BGP clear 路由命令不会重置 BGP 邻居邻接关系。
  • 当交换机配置了启用 soft-reconfiguration inbound 的邻居时,执行 clear in 或 soft clear in 会清除地址族的软重配置表中的路由。这会导致根据任何应用的输入策略重新评估 BGP 表中的路由。
  • 当交换机配置了未启用 soft-reconfiguration inbound 选项的邻居时,执行 clear in 或 soft in 会向对等体发送路由刷新消息。
  • 出站 BGP clear 命令(out 或 soft out)会将所有路由重新通告给 BGP 对等体。
  • 未指定方向(inout)的 BGP soft clear 命令不会重置 BGP 邻居邻接关系,并且会影响入站和出站路由,如上所述,具体取决于您是否启用 soft-reconfiguration inbound

要清除和刷新所有 IPv4 入站路由

cumulus@leaf01:~$ nv action clear vrf default router bgp address-family ipv4-unicast soft in

要清除和重新发送所有 IPv6 出站路由

cumulus@leaf01:~$ nv action clear vrf default router bgp address-family ipv6-unicast soft out

要清除和刷新所有 EVPN 入站路由

cumulus@leaf01:~$ nv action clear vrf default router bgp address-family l2vpn-evpn soft in

要清除和重新发送所有出站 IPv4 路由

cumulus@leaf01:~$ nv action clear vrf default router bgp address-family ipv4-unicast soft out

要清除和重新发送到 BGP 邻居 10.10.10.101 的所有 IPv6 出站路由

cumulus@leaf01:~$ nv action clear vrf default router bgp neighbor 10.10.10.101 address-family ipv6-unicast out

要清除和重新发送 BGP 对等组 SPINES 的所有地址族(IPv4、IPv6 和 l2vpn-evpn)的出站路由

cumulus@leaf01:~$ nv action clear vrf default router bgp peer-group SPINES out

要清除和刷新所有 VRF 和地址族的所有 IPv4 入站路由

cumulus@switch:~$ nv action clear router bgp soft in
Action succeeded

要清除和刷新所有邻居、地址族和 VRF 的入站路由,并刷新出站路由过滤前缀列表

cumulus@switch:~$ nv action clear router bgp in prefix-filter
Action succeeded

要清除与所有邻居的 BGP 会话,强制邻居重新启动

cumulus@switch:~$ nv action clear router bgp
Action succeeded

要清除和刷新所有 IPv4 入站路由

cumulus@spine01:~$ sudo vtysh
...
switch# clear bgp vrf default ipv4 unicast * soft in
switch# exit

要清除和重新发送所有 IPv6 出站路由

cumulus@spine01:~$ sudo vtysh
...
switch# clear bgp vrf default ipv6 unicast * soft out
switch# exit

要清除和刷新所有 EVPN 入站路由

cumulus@spine01:~$ sudo vtysh
...
switch# clear bgp vrf default l2vpn evpn * soft in
switch# exit

要清除和重新发送所有出站 IPv4 路由

cumulus@spine01:~$ sudo vtysh
...
switch# clear bgp vrf default ipv4 unicast * soft out
switch# exit

要清除和重新发送到 BGP 邻居 10.10.10.101 的所有 IPv6 出站路由

cumulus@spine01:~$ sudo vtysh
...
switch# clear bgp vrf default ipv6 unicast 10.10.10.101 out
switch# exit

要清除和重新发送 BGP 对等组 SPINES 的所有地址族(IPv4、IPv6 和 l2vpn-evpn)的出站路由

cumulus@spine01:~$ sudo vtysh
...
switch# clear bgp vrf default peer-group SPINES out
switch# exit

要清除和刷新所有邻居、地址族和 VRF 的入站路由,并刷新出站路由过滤前缀列表

cumulus@spine01:~$ sudo vtysh
...
switch# clear bgp in prefix-filter
switch# exit

要清除与所有邻居的 BGP 会话,强制邻居重新启动

cumulus@switch:~$ sudo vtysh
...
switch# clear bgp *
switch# write memory
switch# exit