Continue
原 因分析:
OSPF 管理距离 110 BGP 的 EBGP 管理距离 20
路由走 BGP ,但是 OSPF 宣告的 1.1.1 .1 的 IGP 可达, BGP 利用 1.1.1.1 建立邻居
当 BGP 路由传输 1.1.1 .1 到 R2 上时, OSPF 宣告的 IGP 可达路由 1.1.1.1 被顶掉
BGP 邻居 DOWN 掉。过一段时间, OSPF 继续起用 BGP 邻居又建立成功,因此
BGP 的路由发生抖动。
解 决方法:
BGP 利用物理接口建立邻居
第 二种 BGP 抖动情况: OSPF 做 IGP BGP 用物理接口建立邻居 环回口打开 关闭
配置命令:
r1#conf t
r1(config)#router bgp 123
r1(config-router )#no au
r1(config-router)#no sy
r1(config-router)#bgp router-id 1.1.1.1
r1(config-router)#neighbor 192.168.12.2 remote-as 456
r1(config-router)#net 1.1.1.1 m 255.255.255.255
r1(config-router-af)#^Z
r2#conf t
r2(config)#router bgp 456
r2(config-router)#no au
r2(config-router)#no sy
r2(config-router)#bgp router-id 2.2.2.2
r2(config-router)#neighbor 192.168.12.1 remote-as 123
r2(config-router-af)#^Z
通过 route-map 抓 1.1.1 .1 流量观察 BGP 抖动路由情况
r2(config)#ip prefix-list 1 permit 1.1.1.1/32 // 配置 prefix-list 控制 1.1.1.1 流量
r2(config)#route-map damp permit 10 // 配置 route-map
r2(config-route-map)#match ip add prefix-list 1 // 匹配 prefix-list
r2(config-route-map)#set dampening 15 750 2000 60
// 匹配属性 这 4 个参数的缺省值分别是:半衰期: 15 分钟 开始抑制阀值: 2000 重新启用阀值: 750 最大抑制时间: 60 分钟
r2(config-route-map)#^Z
r2(config)#router bgp 456
r2(config-router)#bgp dampening // 启动 BGP 惩罚
r2(config-router)#neighbor 192.168.12.1 route-map damp in // 调用 route-map 控制流量
开 始通过 R1 宣告的 1.1.1 .1 路由在 R2 上显示为最优
r1(config)#int lo 0
r1(config-if)#shutdown
r2#show ip bgp
BGP table version is 5, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
h 1.1.1.1/32 192.168.12.1 0 0 123 i
//h 表示历史中出现过这条路由
r1(config)#int lo 0
r1(config-if)#no shutdown
r2#show ip bgp
BGP table version is 4, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 192.168.12.1 0 0 123 i
// 环回口打开又出现最优路由
r1(config)#int lo 0
r1(config-if)#shutdown
r2#show ip bgp
BGP table version is 9, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*d 1.1.1 .1/32 192.168.12.1 0 0 123 i
//*d 表示路由被抑制