<a href="http://blog.51cto.com/attachment/201105/161641462.png" target="_blank"></a>
今天做BGP遇到點問題寫下來
我們知道BGP路由黑洞,假若R4和R5沒有運作BGP協定,這時候我們在R6上仍可以看到R1通告的路由條目,但是在R3R4處由于不知道到達R1的路由,會造成丢包目标位址不可達。我們解決的步驟就是要麼全互聯(full mash)反射器 聯盟 。前提我們先說下BGP的優化 。
1.優化首先要解決同步問題,那什麼是同步那?同步就是路由從IBGP學到的路由不會傳給其他的鄰居,直到從IGP也要到這個條目(從EBGP學到的則沒有這個限制),假若我們在R1上通告了一條路由,R2學到傳給R3 R4這時R3 R4是不會傳給R5的.
2.BGP的路由條目不優 是不會放進路由表的,解決不優的條件是關掉同步 在EBGP的路由上打上next-holp-self 意思就是你把我當成下一跳
在12.2(8)T是預設關掉同步的,我們在R2 R5上打上nexp-holp-self 這是就有通向R1和R6的路由,這時即使R3R4沒有運作BGP協定我們覺得方案:
反射器:
<a href="http://blog.51cto.com/attachment/201105/163859604.png" target="_blank"></a>
1.客戶之間可以反射
2.客戶可以反射給非客戶和EBGP鄰居
3.非客戶可以反射到客戶
4.非客戶不能反射給非客戶
5.從EBGP收到的路由可以反射給用戶端和非用戶端
1.R3 R4分别與R2 R5建鄰居
2.把R3R4當作RR neighbor xxxx route-reflectd-client
聯盟:
1.先建小AS 建鄰居
2.申明大AS号自己所屬的
3.小AS之間互指peer
我們把R 2 R4 化為一個小聯盟 R5 R3另一個聯盟 之間見EBGP的關系
router bgp 64512
no synchronization
bgp router-id 4.4.4.4
bgp log-neighbor-changes
bgp confederation identifier 2
bgp confederation peers 64513
neighbor 2.2.2.2 remote-as 64512
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
neighbor 5.5.5.5 remote-as 64513
neighbor 5.5.5.5 ebgp-multihop 255 由于是EBGP的關系設定多跳
neighbor 5.5.5.5 update-source Loopback0
router bgp 64513 用小AS與R6間鄰居
bgp router-id 5.5.5.5
bgp confederation peers 64512
neighbor 4.4.4.4 remote-as 64512
neighbor 4.4.4.4 ebgp-multihop 255
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 next-hop-self
neighbor 56.1.1.6 remote-as 3用小AS與R6間鄰居
no auto-summary
在這我們發現個問題 R4 R5之間建内部的EBGP的關系 這時R1的路由R2上打上nexp-holp-self這時R4上學習的是優的,由于是EBGP的關系R5學到的也是優的
R5#show ip bgp
BGP table version is 5, local router ID is 5.5.5.5
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.0/24 2.2.2.2 0 100 0 (64512) 1 i
這時候我們在R6上也宣告一個BGP的路由
在R5上看優的
R5#show
*Mar 1 03:13:15.099: %SYS-5-CONFIG_I: Configured from console by console
*> 6.6.6.0/24 56.1.1.6 0 0 3 i
在R4上不優
R4#show ip bgp
BGP table version is 6, local router ID is 4.4.4.4
*>i1.1.1.0/24 2.2.2.2 0 100 0 1 i
* 6.6.6.0/24 56.1.1.6 0 100 0 (64513) 3 i
R2# show ip bgp R2也學不到6.6.6.6的路由
BGP table version is 6, local router ID is 2.2.2.2
*> 1.1.1.0/24 12.1.1.1 0 0 1 i
這裡就有個問題同樣是EBGP為何當R4 與R5 建EBGP的鄰居 R1的路由可以傳過來 R6的卻不可以
還需要在R5上指定neighbor 4.4.4.4 nexp-holp-self 我們看制定後的
BGP table version is 7, local router ID is 4.4.4.4
*> 6.6.6.0/24 5.5.5.5 0 100 0 (64513) 3 i
R2# show ip bgp
BGP table version is 7, local router ID is 2.2.2.2
*>i6.6.6.0/24 4.4.4.4 0 100 0 (64513) 3 i
R1#show ip bgp
BGP table version is 11, local router ID is 1.1.1.1
*> 1.1.1.0/24 0.0.0.0 0 32768 i
*> 6.6.6.0/24 12.1.1.2 0 2 3 i
R6#ping 1.1.1.1 source 6.6.6.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 6.6.6.6
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 120/236/424 ms
也通了
關于這點問題真有點想不開,既然都是EBGP的關系 為什麼還有要最優的條件??
本文轉自q狼的誘惑 51CTO部落格,原文連結:http://blog.51cto.com/liangrui/557758,如需轉載請自行聯系原作者