BGP Dual AS Configuration : neighbor local-as 參數釋疑(Part 2)

Neighbor local-as

The neighbor local-as command is used to customize the AS-path attribute by adding and removing AS numbers for routes recevied from EBGP neighbors.

網路架構圖:



現在我們假設ISP A(R1/AS100)併購了ISP B(R2/AS200),因此ISP B(R2)原來的AS200將要改變成為AS100,但是為了不影響客戶的連線及BGP設定,我們必須使用BGP local-as這個參數來使用客戶受影響的層面減到最少的程度,但是Cisco對於R2修改BGP AS number時,跟客戶之間的BGP session至少會中斷40秒至1分鐘左右(假設你copy & paste的速度很快的話)避而不談,所以請各位不要以為可以神不知鬼不覺地轉換BGP AS,事情可是沒有想像中這麼完美的…

因此,我們知道大概在ISP B(R2)上至少有兩個動作要作:
1.修改BGP AS Number(同時ISP A(R1)上也要修改相對應的BGP neighbor config)
2.針對Customer(R3)的BGP neighbor中要加上local-as參數

設定如下:

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router bgp 100
R1(config-router)#neighbor 192.168.1.2 remote-as 100


R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#no router bgp 200
R2(config)#router bgp 100
00:28:43: %BGP-5-ADJCHANGE: neighbor 192.168.1.10 Down BGP protocol initializati
on => 修改BGP AS Number一定會使得BGP session重啟
R2(config-router)# no synchronization
R2(config-router)# bgp log-neighbor-changes
R2(config-router)# network 10.3.3.22 mask 255.255.255.255
R2(config-router)# redistribute connected
R2(config-router)# neighbor 192.168.1.1 remote-as 100
R2(config-router)# neighbor 192.168.1.10 remote-as 300
R2(config-router)# neighbor 192.168.1.10 local-as 200
R2(config-router)# no auto-summary

那麼,我們接著來看看local-as對於BGP AS-Path的變化會是如何呢?

R1#sh ip bgp
BGP table version is 18, local router ID is 10.3.3.11
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
*> 10.3.3.11/32 0.0.0.0 0 32768 i
*>i10.3.3.22/32 192.168.1.2 0 100 0 i
*>i10.3.3.33/32 192.168.1.10 0 100 0 200 300 i
* i192.168.1.0/30 192.168.1.2 0 100 0 ?
*> 0.0.0.0 0 32768 ?
*>i192.168.1.8/30 192.168.1.2 0 100 0 ?

R2#sh ip bgp
BGP table version is 6, local router ID is 10.3.3.22
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
*>i10.3.3.11/32 192.168.1.1 0 100 0 i
*> 10.3.3.22/32 0.0.0.0 0 32768 i
*> 10.3.3.33/32 192.168.1.10 0 0 200 300 i
*> 192.168.1.0/30 0.0.0.0 0 32768 ?
* i 192.168.1.1 0 100 0 ?
* 192.168.1.8/30 192.168.1.10 0 0 200 300 ?
*> 0.0.0.0 0 32768 ?

R3#sh ip bgp
BGP table version is 18, local router ID is 10.3.3.33
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
*> 10.3.3.11/32 192.168.1.9 0 200 100 i
*> 10.3.3.22/32 192.168.1.9 0 0 200 100 i

*> 10.3.3.33/32 0.0.0.0 0 32768 i
*> 192.168.1.0/30 192.168.1.9 0 0 200 100 ?
* 192.168.1.8/30 192.168.1.9 0 0 200 100 ?
*> 0.0.0.0 0 32768 ?

從以上的結果可以看得出來,不論是從R2送出或是從R2收到的BGP AS-Path都會prepend AS200,這就是只使用local-as時的AS-Path變化,緊接著我們再來看看如果後面再加上no-prepend這個參數會產生什麼樣的變化?

Comments

Popular posts from this blog

TCP/IP 明確擁塞通知 (ECN)

集中式數位交換機(CENTREX)系統

WRR(Weighted Round Robin) vs SRR(Shared/Shaped Round Robin)