簡介
本文檔介紹阻止正確建立BGP鄰居關係的問題。
必要條件
需求
本文件沒有特定需求。
採用元件
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
慣例
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
背景資訊
BGP路由器只能在它們之間建立對等連線時交換路由資訊。BGP對等體建立從裝置之間建立TCP連線開始。建立TCP連線後,BGP裝置嘗試透過交換BGP Open消息來建立BGP會話,在此它們交換BGP版本、AS編號、保持時間和BGP識別符號。
在BGP對等體建立過程中,有幾種情況會阻止BGP鄰居關係的正確建立。本檔案將討論造成此問題的一些可能原因:
網路圖表
以下網路圖作為前三個原因的示例:
網路圖表
問題
鄰居陳述式不正確
路由器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命令就知道路由器R1-AGS處於已建立狀態。
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處於已建立狀態。
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
注意:雖然您可以ping通BGP鄰居,但絕對不會使用預設路由建立BGP會話(iBGP/eBGP),並且您會在調試中看到相同的(無路由)輸出。解決方法仍然是向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處於已建立狀態。
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處於已建立狀態。
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
相關資訊