【正文】
R3:R3enable R3configure terminal R3(config)interface serial 0/0R3(configif)no shutdown R3(configif)ip address R3(configif)router bgp 2R3(configrouter)neighbor remoteas 14. 驗證u 查看BGP鄰居是否建立R2(configrouter)do show ip bgp summaryBGP router identifier , local AS number 1BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4 1 5 5 1 0 0 00:02:16 0 4 2 4 4 1 0 0 00:00:44 0u 查看一下觸發(fā)時間R2(configrouter)do show ip bgp neighborBGP neighbor is , remote AS 1, internal link BGP version 4, remote router ID BGP state = Established, up for 00:06:02 Last read 00:00:02, last write 00:00:02, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old amp。 R1:R1enable R1configure terminal R1(config)interface serial 0/0R1(configif)no shutdown R1(configif)ip address R1(configif)router bgp 1R1(configrouter)neighbor remoteas 1216。 原因:當(dāng)路由條目在一定時間閃動多次時,也只有到了最少觸發(fā)時間才會觸發(fā)更新。默認情況下,ibgp為5秒,ebgp為30秒。 new) Address family IPv4 Unicast: advertised and received可以看到時物理接口作為路由器ID5. 設(shè)置環(huán)回接口使其作為路由器IDu 配置R1(configrouter)interface loopback 0R1(configif)ip address R1(configif)do clear ip bgp *u 查看路由器IDR2(configrouter)do show ip bgp neighborBGP neighbor is , remote AS 1, external link BGP version 4, remote router ID BGP state = Established, up for 00:00:37 Last read 00:00:37, last write 00:00:37, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old amp。 R2:R2enable R2configure terminal R2(config)interface serial 0/0R2(configif)no shutdown R2(configif)ip address R2(configif)router bgp 2R2(configrouter)neighbor remoteas 14. 物理地址作為路由器IDu 查看R1路由器IDR1(configrouter)do show ip bgp neighborBGP neighbor is , remote AS 2, external link BGP version 4, remote router ID BGP state = Established, up for 00:01:24 Last read 00:00:24, last write 00:00:24, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old amp。注意:設(shè)置路由器ID最大的好處就是可以人為的控制路由器ID號,建議手工設(shè)置2. 實驗拓撲3. 配置216。 R2:R2enable R2configure terminal R2(config)interface fastEthernet 0/0R2(configif)no shutdown R2(configif)ip address R2(configif)router bgp 2R2(configrouter)neighbor remoteas 1u 查看R1鄰居關(guān)系是否建立R1(configrouter)do show ip bgp summaryBGP router identifier , local AS number 1BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4 2 5 5 1 0 0 00:02:07 0鄰居關(guān)系正常建立3. Bgp fastexternalfalloveru 現(xiàn)在關(guān)閉R1的fastethernet 0/0R1(configrouter)interface fastethernet 0/0R1(configif)shutdownu 查看R1鄰居關(guān)系建立情況R1(configif)do show ip bgp summary BGP router identifier , local AS number 1BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4 2 6 6 0 0 0 00:00:27 Idle發(fā)現(xiàn)鄰居關(guān)系馬上就down了u 現(xiàn)在開啟fastethernet 0/0R1(configrouter)interface fastethernet 0/0R1(configif)no shutdownu 使用no bgp fastexternalfallover,這樣在保持時間內(nèi)鄰居關(guān)系不會關(guān)閉,不管鄰居是不是關(guān)閉狀態(tài)R2(configrouter)no bgp fastexternalfalloveru 關(guān)掉R1 的fastethernet 0/0口R1(configrouter)interface fastethernet 0/0R1(configif)shutdownu 查看R2,BGP鄰居關(guān)系R2(configrouter)do show ip bgp summary BGP router identifier , local AS number 2BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4 1 12 14 1 0 0 00:02:39 0鄰居關(guān)系仍保持u 查看R1R1(configif)do show ip bgp summaryBGP router identifier , local AS number 1BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4 2 12 12 0 0 0 00:01:38 Idle鄰居關(guān)系down掉總結(jié):bgp fastexternalfallover 默認是打開的,意思是如果鄰居關(guān)閉,就會切斷鄰居關(guān)系。2. 配置216。 R2:R2enable R2configure terminal R2(config)interface serial 0/0R2(configif)no shutdown R2(configif)ip address R2(configif)router bgp 1R2(config)router bgp 2 R2(configrouter)neiR2(configrouter)neighbor remoteas 1R2(configrouter)neighbor timers 30 90 //手動修改BGP存活時間和保持時間4. 驗證u 查看R1, BGP建立情況R1(configrouter)do show ip bgp summaryBGP router identifier , local AS number 1BGP table version is 1, main routing table version 1Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4 2 6 6 1 0 0 00:01:14 0鄰居建立完成u 查看R1,BGP鄰居R1(configrouter)do show ip bgp neighbor BGP neighbor is , remote AS 2, external link BGP version 4, remote router ID BGP state = Established, up for 00:04:03 Last read 00:00:03, last write 00:00:03, hold time is 60, keepalive interval is 20 seconds Configured hold time is 60,keepalive interval is 20 seconds Minimum holdtime from neighbor is 0 seconds u 查看R2,BGP鄰居R2(configrouter)do show ip bgp neighbor BGP neighbor is , remote AS 1, external link BGP version 4, remote router ID BGP state = Established, up for 00:02:04 Last read 00:00:04, last write 00:00:04, hold time is 60, keepalive interval is 20 seconds Configured hold time is 90,keepalive interval is 30 seconds Minimum holdtime from neighbor is 0 seconds截取部分看出,當(dāng)兩臺路由器都修改時間時,以最小的為標(biāo)準(注意紅色部分)五、 Bgp fastexternalfallover(20)1. 要點解釋l 默認情況下,這個命令是打開的,意思是鄰居down了,bgp會話也立即關(guān)閉。2. 實驗拓撲3. 配置