取消
显示结果 
搜索替代 
您的意思是: 
cancel
6913
查看次数
0
有帮助
4
评论
ywanxin
Cisco Employee
Cisco Employee

原因:

BGP路由更新的下一条一开始通过IGP学习到,并放入路由表。当BGP更新的下一条通过BGP学习到之后,可能因为IGP和BGP的管理距离分配失误,导致路由器将BGP学习到的路由加入路由表取代IGP学习到的路由。这是,IGP路由表中已经没有关于下一跳的路由信息(而有BGP路由)。此时由于BGP路由能出现>号的前提是,IGP中下一条可达,此时IGP中关于下一跳的路由被BGP取代,所以BGP路由甚至BGP邻居将会DOWN掉。之后IGP路由会浮上来,继续存在于IGP路由表中。之后BGP下一跳可达,BGP路由会取代IGP路由。这样一直循环,导致路由震荡。(解说有些复杂,请看实验)


R1、R2之间运行EIGRP,将管理距离调整为21(EBGP管理距离20,IBGP管理距离为200)。



R1#show run | b router router eigrp 1 network 1.0.0.0 network 12.0.0.0
distance eigrp 21 21
no auto-summary
!



R2#show run | b router
router eigrp 1 network 2.0.0.0 network 12.0.0.0 distance eigrp 21 21
no auto-summary
!

查看R1 IGP路由表



C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnetsD 2.2.2.2 [21/156160] via 12.1.1.2, 00:02:18, FastEthernet0/0 11.0.0.0/32 is subnetted, 1 subnets
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0

此时2.2.2.2通过IGP(EIGRP)学习到。

配置BGP:



R1#show run | b router
router eigrp 1 network 1.0.0.0 network 12.0.0.0 distance eigrp 21 21
no auto-summary
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 2
neighbor 2.2.2.2 ebgp-multihop 255
neighbor 2.2.2.2 update-source Loopback0
no auto-summary
!



R2#show run | b router
router eigrp 1 network 2.0.0.0 network 12.0.0.0 distance eigrp 21 21
no auto-summary
!
router bgp 2
no synchronization
bgp log-neighbor-changes
network 2.2.2.2 mask 255.255.255.255
neighbor 1.1.1.1 remote-as 1
neighbor 1.1.1.1 ebgp-multihop 255
neighbor 1.1.1.1 update-source Loopback0
no auto-summary
!

☆R2将关于2.2.2.2/32的BGP更新发送给R1,且R2配置有upadte-source lo0,所以关于2.2.2.2/32的下一条为2.2.2.2,R1收到该路由更新,查找IGP路由表,发现存在一条有EIGRP学习到的2.2.2.2的路由,即BGP下一条可达,于是路由器会将BGP学习到的2.2.2.2/32的路由放入路由表。由于通过EIGRP AD被手动修改为21>20,所以EIGRP学习到的2.2.2.2/32路由将会撤离路由表。



R1#show ip route Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
B 2.2.2.2 [20/0] via 2.2.2.2, 00:01:29
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0

到此问题就出来了。因为IGP中没有关于2.2.2.2/32的下一跳2.2.2.2的路由,TCP连接无法正常维护,导致BGPkeapalive消息无法成功发送到邻居,也无法收到来自邻居的keapalive消息.open message中定义了一个hold time=180秒。如果180秒之后无法收到邻居的keapalive message,BGP session将会down(抓包可以看到一个NOTIFICATION MESSAGE消息)。所以等180秒之后,BGP邻居将会down,通过BGP路由从路由表撤离。继而EIGRP关于2.2.2.2/32上浮,加入路由表。



R1#show ip route

Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
D 2.2.2.2 [21/156160] via 12.1.1.2, 00:01:12, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0

此时,2.2.2.2下一条可达,BGP邻居重新建立。回到带星号☆标注的步骤,如此循环,导致BGP路由震荡。

下面是BGP的日志信息:



*May 22 17:28:46.643: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
R1#
*May 22 17:31:47.699: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down BGP Notification sent
R1#
*May 22 17:31:47.699: %BGP-3-NOTIFICATION: sent to neighbor 2.2.2.2 4/0 (hold time expired) 0 bytes
R1#
*May 22 17:31:49.931: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
R1#
*May 22 17:34:55.091: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down BGP Notification sent

可以看到邻居关系从UPàDown时间为3分钟。


评论
one-time
Level 13
Level 13
谢谢楼主分享!
cpmld-199
Community Member
谢谢分享。
zhihao zou
Level 1
Level 1
这个问题多半由于工程师误操作引发的
superspace521
Spotlight
Spotlight
学习了,谢楼主
入门指南

使用上面的搜索栏输入关键字、短语或问题,搜索问题的答案。

我们希望您在这里的旅程尽可能顺利,因此这里有一些链接可以帮助您快速熟悉思科社区:









快捷链接