46、BGP配置實驗之Aspath選路

1、as-path選路解析

成都創(chuàng)新互聯(lián)成立與2013年,先為嶗山等服務建站,嶗山等地企業(yè),進行企業(yè)商務咨詢服務。為嶗山企業(yè)網(wǎng)站制作PC+手機+微官網(wǎng)三網(wǎng)同步一站式服務解決您的所有建站問題。

屬性
傳播范圍
默認值
優(yōu)先值方向
備注
weight本路由器本路由器32768,其他路由器0大值優(yōu)先INCISCO私有

Local preferenceAS內(nèi)部100:邊界路由器,通告給IBGP鄰居,告知如何離開本AS大值優(yōu)先OUT
As pathAS之間短優(yōu)先IN、OUT

修改As path值的方法:

方法一:在OUT方向上修改As path值,例如

ip prefix-list 1 seq 5 permit 33.33.33.0/24

route-map AS permit 10

 match ip address prefix-list 1

 set as-path prepend 2 2 2 2 2

route-map AS permit 20

router bgp 3

 neighbor 23.1.1.2 route-map AS out

方法二:在IN方向上修改As path值,例如

2、實驗拓撲

46、BGP配置實驗之As path選路3、基礎配置

R1配置

interface Loopback0

 ip address 1.1.1.1 255.255.255.0

interface Serial0/0

 ip address 13.1.1.1 255.255.255.0

interface Serial0/1

 ip address 14.1.1.1 255.255.255.0

router ospf 110

 router-id 1.1.1.1

 log-adjacency-changes

 network 1.1.1.0 0.0.0.255 area 0

 network 14.1.1.0 0.0.0.255 area 0

router bgp 4

 no synchronization

 bgp router-id 1.1.1.1

 neighbor 4.4.4.4 remote-as 4

 neighbor 4.4.4.4 update-source Loopback0

 neighbor 4.4.4.4 next-hop-self

 neighbor 13.1.1.3 remote-as 3

 no auto-summary

R2配置

interface Loopback0

 ip address 2.2.2.2 255.255.255.0

interface Serial0/1

 ip address 23.1.1.2 255.255.255.0

interface FastEthernet1/0

 ip address 24.1.1.2 255.255.255.0

router ospf 110

 router-id 2.2.2.2

 network 2.2.2.0 0.0.0.255 area 0

 network 24.1.1.0 0.0.0.255 area 0

router bgp 4

 no synchronization

 bgp router-id 2.2.2.2

 neighbor 4.4.4.4 remote-as 4

 neighbor 4.4.4.4 update-source Loopback0

 neighbor 4.4.4.4 next-hop-self

 neighbor 23.1.1.3 remote-as 3

 no auto-summary

R3配置

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

interface Loopback1

 ip address 33.33.33.33 255.255.255.0        

interface Serial0/0

 ip address 13.1.1.3 255.255.255.0

interface Serial0/1

 ip address 23.1.1.3 255.255.255.0router bgp 3

 no synchronization

 bgp router-id 3.3.3.3

 network 3.3.3.0 mask 255.255.255.0

 network 33.33.33.0 mask 255.255.255.0

 neighbor 13.1.1.1 remote-as 4

 neighbor 23.1.1.2 remote-as 4

 no auto-summary

R4配置

interface Loopback0

 ip address 4.4.4.4 255.255.255.0

interface Serial0/1

 ip address 14.1.1.4 255.255.255.0

interface FastEthernet1/0

 ip address 24.1.1.4 255.255.255.0

router ospf 110

 router-id 4.4.4.4

 network 4.4.4.0 0.0.0.255 area 0

 network 14.1.1.0 0.0.0.255 area 0

 network 24.1.1.0 0.0.0.255 area 0

router bgp 4

 no synchronization

 bgp router-id 4.4.4.4

 neighbor 1.1.1.1 remote-as 4

 neighbor 1.1.1.1 update-source Loopback0

 neighbor 2.2.2.2 remote-as 4

 neighbor 2.2.2.2 update-source Loopback0

 no auto-summary

4、默認選路

46、BGP配置實驗之As path選路根據(jù)BGP選路原則第八條可以知道,R4到達3.3.3.0/24、33.33.33.0/24都是經(jīng)過R2。

46、BGP配置實驗之As path選路

46、BGP配置實驗之As path選路

5、在OUT方向上修改As path值

R4到達3.3.3.0/24、33.33.33.0/24都是經(jīng)過R2,我們通過修改As path值將R4到達3.3.3.0/24經(jīng)過R2、達到33.33.33.0/24都是經(jīng)過R1。

R3配置

ip prefix-list 1 seq 5 permit 33.33.33.0/24

route-map AS permit 10

 match ip address prefix-list 1

 set as-path prepend 2 2 2 2 2

route-map AS permit 20

router bgp 3

 neighbor 23.1.1.2 route-map AS out

46、BGP配置實驗之As path選路

6、在IN方向上修改As path值

R4到達3.3.3.0/24、33.33.33.0/24都是經(jīng)過R2,我們通過修改As path值將R4到達3.3.3.0/24經(jīng)過R2、達到33.33.33.0/24都是經(jīng)過R1。

R2配置

ip prefix-list 1 seq 5 permit 33.33.33.0/24

route-map AS permit 10

 match ip address prefix-list 1

 set as-path prepend 2 2 2 2 2

route-map AS permit 20

router bgp 4

 neighbor 23.1.1.3 route-map AS in

46、BGP配置實驗之As path選路

網(wǎng)頁題目:46、BGP配置實驗之Aspath選路
分享網(wǎng)址:http://bm7419.com/article4/pcicoe.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、用戶體驗網(wǎng)站營銷、營銷型網(wǎng)站建設微信小程序、關(guān)鍵詞優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設