簡介
本文描述使BGP鄰居關係無法正確建立的問題。
必要條件
需求
本文件沒有特定需求。
採用元件
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
慣例
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
背景資訊
BGP路由器只有在之間建立對等連線時才能交換路由資訊。
BGP對等體建立從在裝置之間建立TCP連線開始。
建立TCP連線後,BGP裝置嘗試透過交換BGP Open訊息來建立BGP作業階段,在此,它們交換BGP版本、AS編號、保留時間和BGP識別碼。
在BGP對等體建立過程中,有幾種情況會阻止BGP鄰居關係的正確建立。本文討論導致此問題的一些可能原因:
網路圖表
使用以下網路圖作為前三個原因的範例:
網路圖表
問題
Neighbor語句不正確
路由器R1-AGS上的show ip bgp summary命令顯示會話處於活動狀態。
R1-AGS(9)#show ip bgp summary
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.10.10.2 4 400 0 0 0 0 0 never Active
配置如下:
R1-AGS |
R6-2500 |
interface Loopback0
ip address 10.2.2.2 255.255.255.255
!
interface Serial1
ip address 10.10.10.1 255.255.255.0
!
router bgp 400
neighbor 10.10.10.2 remote-as 400
neighbor 10.10.10.2 update-source Loopback0
!
ip route 10.1.1.1 255.255.255.255 10.10.10.2 |
interface Loopback0
ip address 10.1.1.1 255.255.255.255
!
interface Serial0
ip address 10.10.10.2 255.255.255.0
!
router bgp 400
neighbor 10.10.10.1 remote-as 400
neighbor 10.10.10.1 update-source Loopback0
!
ip route 10.2.2.2 255.255.255.255 10.10.10.1 |
debug ip bgp 和debug ip tcp transactions 命令顯示TCP連線失敗。
路由器R1-AGS上的調試:
BGP: 10.10.10.2 open active, local address 10.2.2.2
TCB00135978 created
TCB00135978 setting property 0 16ABEA
TCB00135978 bound to 10.2.2.2.11039
TCP: sending SYN, seq 3797113156, ack 0
TCP0: Connection to 10.10.10.2:179, advertising MSS 1460
TCP0: state was CLOSED -> SYNSENT [11039 -> 10.10.10.2(179)]
TCP0: state was SYNSENT -> CLOSED [11039 -> 10.10.10.2(179)]
TCP0: bad seg from 10.10.10.2 -- closing connection: seq 0 ack 3797113157 rcvnxt 0 rcvwnd 0
TCP0: connection closed - remote sent RST
TCB00135978 destroyed
BGP: 10.10.10.2 open failed: Connection refused by remote host
TCP: sending RST, seq 0, ack 1965664223
TCP: sent RST to 10.1.1.1:11016 from 10.10.10.1:179
路由器R6-2500上的調試:
TCP: sending RST, seq 0, ack 3797113157
TCP: sent RST to 10.2.2.2:11039 from 10.10.10.2:179
BGP: 10.10.10.1 open active, local address 10.1.1.1
TCB001E030C created
TCB001E030C setting property TCP_WINDOW_SIZE (0) 194F7A
TCB001E030C setting property TCP_TOS (11) 194F79
TCB001E030C bound to 10.10.1.1.11016
TCP: sending SYN, seq 1965664222, ack 0
TCP0: Connection to 10.10.10.1:179, advertising MSS 1460
TCP0: state was CLOSED -> SYNSENT [11016 -> 10.10.10.1(179)]
TCP0: state was SYNSENT -> CLOSED [11016 -> 10.10.10.1(179)]
TCP0: bad seg from 10.10.10.1 -- closing connection: seq 0 ack 1965664223 rcvnxt 0 rcvwnd 0
TCP0: connection closed - remote sent RST
TCB 0x1E030C destroyed
BGP: 10.10.10.1 open failed: Connection refused by remote host
解決方案
若要糾正此情況,請更正neighbor語句中的環回地址,或從配置中刪除update-source命令。
在本例中,地址被更正。
R1-AGS |
R6-2500 |
router bgp 400
neighbor 10.1.1.1 remote-as 400
neighbor 10.1.1.1 update-source Loopback0
!
ip route 10.1.1.1 255.255.255.255 10.10.10.2
|
router bgp 400
neighbor 10.2.2.2 remote-as 400
neighbor 10.2.2.2 update-source Loopback0
!
ip route 10.2.2.2 255.255.255.255 10.10.10.1
|
檢視show ip bgp summary命令可顯示Router R1-AGS處於established狀態。
R1-AGS(9)#show ip bgp summary
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.1.1.1 4 400 3 3 1 0 0 00:00:26 0
問題
不存在到達鄰居地址的路由,或者使用預設路由到達對等體
路由器R1-AGS上的show ip bgp summary命令顯示會話當前處於活動狀態。
R1-AGS(9)#show ip bgp summary
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.1.1.1 4 400 0 0 0 0 0 never Active
配置如下:
R1-AGS |
R6-2500 |
interface Loopback0
ip address 10.2.2.2 255.255.255.255
!
interface Serial1
ip address 10.10.10.1 255.255.255.0
!
router bgp 300
neighbor 10.1.1.1 remote-as 400
neighbor 10.1.1.1 ebgp-multihop 2
neighbor 10.1.1.1 update-source Loopback0 |
interface Loopback0
ip address 10.1.1.1 255.255.255.255
!
interface Serial0
ip address 10.10.10.2 255.255.255.0
!
router bgp 400
neighbor 10.2.2.2 remote-as 300
neighbor 10.2.2.2 ebgp-multihop 2
neighbor 10.2.2.2 update-source Loopback0 |
如果執行debug命令,則顯示沒有通往鄰居的路由。
路由器R1-AGS上的調試:
BGP: 10.1.1.1 open active, delay 9568ms
BGP: 10.1.1.1 multihop open delayed 19872ms (no route)
BGP: 10.1.1.1 multihop open delayed 12784ms (no route)
路由器R6-2500上的調試:
BGP: 10.2.2.2 open active, delay 6531ms
BGP: 10.2.2.2 multihop open delayed 14112ms (no route)
BGP: 10.2.2.2 multihop open delayed 15408ms (no route)
解決方案
解決方式是在BGP neighbor語句中包括到下一跳的路由。根據情況使用靜態或動態路由。
在您具有更多控制權的內部BGP(iBGP)環境中,您可以使用路由通訊協定動態傳播路由。
在外部BGP(eBGP)情況下,建議設定靜態路由以到達下一躍點。
附註:只有當您在eBGP對等路由器上對等的IP地址未直接連線時,才使用neighbor ebgp-multihop命令。
在此示例中,使用靜態路由。
R1-AGS |
R6-2500 |
router bgp 300
neighbor 10.1.1.1 remote-as 400
neighbor 10.1.1.1 ebgp-multihop 2
neighbor 10.1.1.1 update-source Loopback0
!
ip route 10.1.1.1 255.255.255.255 10.10.10.2
|
router bgp 400
neighbor 10.2.2.2 remote-as 300
neighbor 10.2.2.2 ebgp-multihop 2
neighbor 10.2.2.2 update-source Loopback0
!
ip route 10.2.2.2 255.255.255.255 10.10.10.1
|
show ip bgp summary命令會顯示路由器R1-AGS處於established狀態。
R1-AGS(9)#show ip bgp summary
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.1.1.1 4 400 3 3 1 0 0 00:00:26 0
附註:預設路由永遠不會用於建立BGP作業階段(iBGP/eBGP),而且雖然您可以ping通BGP鄰居,但您在偵錯中會看到相同的(無路由)輸出。解決方式再次是向BGP鄰居新增路由。
問題
BGP下缺少Update-source命令
路由器R1-AGS上的show ip bgp summary命令顯示會話處於活動狀態。
R1-AGS(9)#show ip bgp summary
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.1.1.1 4 400 0 0 0 0 0 never Active
配置如下:
R1-AGS |
R6-2500 |
interface Loopback0
ip address 10.2.2.2 255.255.255.255
!
interface Serial1
ip address 10.10.10.1 255.255.255.0
!
router bgp 400
neighbor 10.1.1.1 remote-as 400
!
ip route 10.1.1.1 255.255.255.255 10.10.10.2 |
interface Loopback0
ip address 10.1.1.1 255.255.255.255
!
interface Serial0
ip address 10.10.10.2 255.255.255.0
!
router bgp 400
neighbor 10.2.2.2 remote-as 400
!
ip route 10.2.2.2 255.255.255.255 10.10.10.1 |
如果執行debug指令,會顯示TCP連線失敗。
路由器R1-AGS上的調試:
TCP: sending RST, seq 0, ack 2248020754
TCP: sent RST to 10.10.10.2:11018 from 10.2.2.2:179
BGP: 10.1.1.1 open active, local address 10.10.10.1
TCB0016B06C created
TCB0016B06C setting property 0 16ADEA
TCB0016B06C bound to 10.10.10.1.11042
TCP: sending SYN, seq 4099938541, ack 0
TCP0: Connection to 10.1.1.1:179, advertising MSS 536
TCP0: state was CLOSED -> SYNSENT [11042 -> 10.1.1.1(179)]
TCP0: state was SYNSENT -> CLOSED [11042 -> 10.1.1.1(179)]
TCP0: bad seg from 10.1.1.1 -- closing connection: seq 0 ack 4099938542 rcvnxt 0 rcvwnd 0
TCP0: connection closed - remote sent RST
TCB0016B06C destroyed
BGP: 10.1.1.1 open failed: Connection refused by remote host
路由器R6-2500上的調試:
BGP: 10.2.2.2 open active, local address 10.10.10.2
TCB00194800 created
TCB00194800 setting property TCP_WINDOW_SIZE (0) E6572
TCB00194800 setting property TCP_TOS (11) E6571
TCB00194800 bound to 10.10.10.2.11018
TCP: sending SYN, seq 2248020753, ack 0
TCP0: Connection to 10.2.2.2:179, advertising MSS 556
TCP0: state was CLOSED -> SYNSENT [11018 -> 10.2.2.2(179)]
TCP0: state was SYNSENT -> CLOSED [11018 -> 10.2.2.2(179)]
TCP0: bad seg from 10.2.2.2 -- closing connection: seq 0 ack 2248020754 rcvnxt 0 rcvwnd 0
TCP0: connection closed - remote sent RST
TCB 0x194800 destroyed
BGP: 10.2.2.2 open failed: Connection refused by remote host
TCP: sending RST, seq 0, ack 4099938542
TCP: sent RST to 10.10.10.1:11042 from 10.1.1.1:179
解決方案
為了解決此問題,請在兩台路由器上配置update-source命令,或在兩台路由器上刪除update-source命令並更改neighbor語句。
以下是這兩種解決方案的示例。
兩台路由器上均設定了update-source命令:
R1-AGS |
R6-2500 |
interface Loopback0
ip address 10.2.2.2 255.255.255.255
!
interface Serial1
ip address 10.10.10.1 255.255.255.0
!
router bgp 400
neighbor 10.1.1.1 remote-as 400
neighbor 10.1.1.1 update-source Loopback0
!
ip route 10.1.1.1 255.255.255.255 10.10.10.2 |
interface Loopback0
ip address 10.1.1.1 255.255.255.255
!
interface Serial0
ip address 10.10.10.2 255.255.255.0
!
router bgp 400
neighbor 10.2.2.2 remote-as 400
neighbor 10.2.2.2 update-source Loopback0
!
ip route 10.2.2.2 255.255.255.255 10.10.10.1 |
show ip bgp summary命令會顯示路由器R1-AGS處於established狀態。
R1-AGS(9)#
show ip bgp summary
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.2.2.2 4 400 3 3 1 0 0 00:00:26 0
如果有人正在對等您的環回地址,您只需使用update-source命令。iBGP對等體和eBGP對等體也是如此。
此時會刪除update-source命令,並更改兩台路由器上的neighbor語句。
R1-AGS |
R6-2500 |
interface Loopback0
ip address 10.2.2.2 255.255.255.255
!
interface Serial1
ip address 10.10.10.1 255.255.255.0
!
router bgp 400
neighbor 10.10.10.2 remote-as 400
|
interface Loopback0
ip address 10.1.1.1 255.255.255.255
!
interface Serial0
ip address 10.10.10.2 255.255.255.0
!
router bgp 400
neighbor 10.10.10.1 remote-as 400
|
show ip bgp summary命令會顯示路由器R1-AGS處於established狀態。
R1-AGS(9)#show ip bgp summary
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.10.10.2 4 400 3 3 1 0 0 00:00:26 0
相關資訊