十年網(wǎng)站開(kāi)發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶(hù) + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營(yíng)維護(hù)+專(zhuān)業(yè)推廣+無(wú)憂(yōu)售后,網(wǎng)站問(wèn)題一站解決
1、Local preference選路解析
屬性 | 傳播范圍 | 默認(rèn)值 | 優(yōu)先值 | 方向 | 備注 |
weight | 本路由器 | 本路由器32768,其他路由器0 | 大值優(yōu)先 | IN | CISCO私有 |
Local preference | AS內(nèi)部 | 100:邊界路由器,通告給IBGP鄰居,告知如何離開(kāi)本AS | 大值優(yōu)先 | OUT |
修改Local preference值的方法:
方法一:全部修改通告給IBGP鄰居的路由的Local preference值,例如:
router bgp 4
bgp default local-preference 125
方法二:部分修改通告給IBGP鄰居的路由的Local preference值,例如:
2、實(shí)驗(yàn)拓?fù)?/p>
3、基礎(chǔ)配置
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、默認(rèn)選路
根據(jù)BGP選路原則第八條可以知道,R4到達(dá)3.3.3.0/24、33.33.33.0/24都是經(jīng)過(guò)R2。
5、全部修改通告給IBGP鄰居的路由的Local preference值
由前面可以R4到達(dá)3.3.3.0/24、33.33.33.0/24都是經(jīng)過(guò)R2,我們通過(guò)修改Local preference值將R4到達(dá)3.3.3.0/24、33.33.33.0/24都是經(jīng)過(guò)R1。
R4配置
router bgp 4
bgp default local-preference 125
6、部分修改通告給IBGP鄰居的路由的Local preference值
R4到達(dá)3.3.3.0/24、33.33.33.0/24都是經(jīng)過(guò)R2,我們通過(guò)修改Local preference值將R4到達(dá)3.3.3.0/24經(jīng)過(guò)R2、達(dá)到33.33.33.0/24都是經(jīng)過(guò)R1。
R4配置
ip prefix-list 1 seq 5 permit 33.33.33.0/24
no cdp log mismatch duplex
route-map L permit 10
match ip address prefix-list 1
set local-preference 125
route-map L permit 20
router bgp 4
neighbor 4.4.4.4 route-map L out
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線(xiàn),公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。