本地在 show ip bgp 输出中

网络工程 思科 bgp
2021-07-08 09:23:54

此输出中的 Local 是什么意思?

R4#show ip bgp 10.6.0.0/24  
BGP routing table entry for 10.6.0.0/24, version 19  
Paths: (1 available, best #1, table Default-IP-Routing-Table)  
  Advertised to update-groups:  
        2  
  **Local**    192.168.0.6 (metric 156160) from 192.168.0.5 (192.168.0.5)  
      Origin IGP, metric 0, localpref 100, valid, internal, best  
      Originator: 192.168.0.6, Cluster list: 192.168.0.5
1个回答

Local在您的问题中突出显示关键字意味着前缀在该路由器的 AS 中本地来源(即没有 AS 路径)。

考虑两个配置,其中路由器之间有 BGP 会话,并DEN-EDGE-01宣布 10.204.1.1/32。

Announce:10.204.1.1/32
DEN-EDGE-01----------------DEN-EDGE-02
172.16.1.203               172.16.1.204

同一个 ASN 内的对等互连:Local显示的关键字

DEN-EDGE-01 在 AS100 中配置为发送 10.204.1.1...

router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 10.204.1.1 mask 255.255.255.255
 ! Send 10.204.1.1 to DEN-EDGE-02
 neighbor 172.16.2.204 remote-as 100
 no auto-summary

DEN-EDGE-02 在 AS100 中配置了...

router bgp 100
 no synchronization
 bgp log-neighbor-changes
 ! Just receive routes from DEN-EDGE-01
 neighbor 172.16.2.203 remote-as 100
 no auto-summary
!

当我在 上收到 10.204.1.1 时DEN-EDGE-02,没有 AS-path,只有Local

DEN-EDGE-02#sh ip bgp 10.204.1.1
BGP routing table entry for 10.204.1.1/32, version 2
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  Local   <------------
    172.16.2.203 from 172.16.2.203 (172.16.2.203)
      Origin IGP, metric 0, localpref 100, valid, internal, best
DEN-EDGE-02#

使用不同的 ASN 对等互连:显示的 AS 路径

现在我们重新配置两个路由器……一个在 AS100 中,另一个在 AS200 中。 DEN-EDGE-01在 AS100 中配置为发送 10.204.1.1...

router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 10.204.1.1 mask 255.255.255.255
 ! Send 10.204.1.1 to DEN-EDGE-02
 neighbor 172.16.2.204 remote-as 200
 no auto-summary

DEN-EDGE-02 在AS200中配置了...

router bgp 200
 no synchronization
 bgp log-neighbor-changes
 ! Just receive routes from DEN-EDGE-01
 neighbor 172.16.2.203 remote-as 100
 no auto-summary
!

当我收到 10.204.1.1 时DEN-EDGE-02,现在我们看到了一个真正的 AS 路径,因为DEN-EDGE-01在不同的 AS 中。

DEN-EDGE-02#sh ip bgp 10.204.1.1
BGP routing table entry for 10.204.1.1/32, version 2
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  100   <------------
    172.16.2.203 from 172.16.2.203 (172.16.2.203)
      Origin IGP, metric 0, localpref 100, valid, external, best
DEN-EDGE-02#