BGP團(tuán)體屬性(實(shí)驗(yàn))-創(chuàng)新互聯(lián)

根據(jù)BGP路由的團(tuán)體屬性設(shè)置BGP路由策略

成都創(chuàng)新互聯(lián)公司服務(wù)項(xiàng)目包括隆德網(wǎng)站建設(shè)、隆德網(wǎng)站制作、隆德網(wǎng)頁(yè)制作以及隆德網(wǎng)絡(luò)營(yíng)銷策劃等。多年來(lái),我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢(shì)、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,隆德網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到隆德省份的部分城市,未來(lái)相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!

BGP團(tuán)體屬性(實(shí)驗(yàn))

R1配置:

Loopback0 1.1.1.1

Loopback1 192.168.1.1/24

Loopback2 192.168.2.1/24

Loopback3 192.168.3.1/24

Loopback4 192.168.4.1/24

E1/0 10.1.12.1

R2配置:

Loopback 2.2.2.2

E1/0 10.1.12.2

配置IGP(RIP)保持連通性:

R1配置:

router rip

 version 2

 network 1.0.0.0

 network 10.0.0.0

 network 192.168.1.0

 network 192.168.2.0

 network 192.168.3.0

 network 192.168.4.0

 no auto-summary

R2配置:

router rip

 version 2

 network 2.0.0.0

 network 10.0.0.0

 no auto-summary

開始配置BGP(EBGP):

R1

router bgp 109

 bgp router-id 1.1.1.1

 bgp log-neighbor-changes

 network 1.1.1.1 mask 255.255.255.255

 network 10.1.12.0 mask 255.255.255.0

 network 192.168.1.0

 network 192.168.2.0

 network 192.168.3.0

 network 192.168.4.0

 neighbor 10.1.12.2 remote-as 110

R2

router bgp 110

 bgp router-id 2.2.2.2

 bgp log-neighbor-changes

 network 1.1.1.1 mask 255.255.255.255

 network 10.1.12.0 mask 255.255.255.0

 neighbor 10.1.12.1 remote-as 109

 neighbor 10.1.12.1 route-map set_local_pref in

R2#sh ip bgp

BGP table version is 7, local router ID is 2.2.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

             r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

             x best-external, a additional-path, c RIB-compressed,

Origin codes: i - IGP, e - EGP, ? - incomplete

RPKI validation codes: V valid, I invalid, N Not found

     Network         Next Hop           Metric LocPrf Weight Path

 *> 1.1.1.1/32      10.1.12.1               1        32768 i

 *> 10.1.12.0/24    0.0.0.0                 0        32768 i

 *> 192.168.1.0     10.1.12.1               0   200      0 109 i

 *> 192.168.2.0     10.1.12.1               0   200      0 109 i

 *> 192.168.3.0     10.1.12.1               0   150      0 109 i

 *> 192.168.4.0     10.1.12.1               0   150      0 109 i

R1配置團(tuán)體屬性

第一步:開啟路由器支持團(tuán)體屬性

ip bgp-community new-format

第二步,配置prefix-list列表

ip prefix-list 1 permit 192.168.1.0/24

ip prefix-list 1 permit 192.168.2.0/24

ip prefix-list 2 permit 192.168.3.0/24

ip prefix-list 2 permit 192.168.4.0/24

第三步,配置route-map set_community

route-map set_community permit 10

 match ip address prefix-list 1

 set community 109:1

route-map set_community permit 20

 match ip address prefix-list 2

 set community 109:2

第四步,在BGP當(dāng)中調(diào)用

neighbor 10.1.12.2 send-community

neighbor 10.1.12.2 route-map set_community out

R2上配置route-map set_local_pref,對(duì)R1傳遞過來(lái)的帶有團(tuán)體屬性的路由進(jìn)行匹配,并附上特定的local-preference

第一步:開啟路由器支持團(tuán)體屬性

ip bgp-community new-format

第二步:設(shè)置團(tuán)體屬性列表

ip prefix-list 1 seq 5 permit 192.168.2.0/24

ip prefix-list 1 seq 10 permit 192.168.4.0/24

第三步:

route-map set_local_pref permit 10

 match community 1

 set local-preference 200

route-map set_local_pref permit 20

 match community 2

 set local-preference 150

第四步:在BGP當(dāng)中調(diào)用route-map set_local_pref

neighbor 10.1.12.1 route-map set_local_pref in

驗(yàn)證配置:

R2#sh ip bgp

BGP table version is 7, local router ID is 2.2.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

             r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

             x best-external, a additional-path, c RIB-compressed,

Origin codes: i - IGP, e - EGP, ? - incomplete

RPKI validation codes: V valid, I invalid, N Not found

     Network         Next Hop           Metric LocPrf Weight Path

 *> 1.1.1.1/32      10.1.12.1               1        32768 i

 *> 10.1.12.0/24    0.0.0.0                 0        32768 i

 *> 192.168.1.0      10.1.12.1               0   200      0 109 i

 *>  192.168.2.0     10.1.12.1               0   200      0 109 i

 *>  192.168.3.0     10.1.12.1               0   150      0 109 i

 *>  192.168.4.0     10.1.12.1               0   150      0 109 i

R2#sh ip bgp 192.168.1.0

BGP routing table entry for 192.168.1.0/24, version 2

Paths: (1 available, best #1, table default)

 Not advertised to any peer

 Refresh Epoch 1

 109

   10.1.12.1 from 10.1.12.1 (1.1.1.1)

     Origin IGP, metric 0, localpref 200, valid, external, best

     Community: 109:1

     rx pathid: 0, tx pathid: 0x0

從R1學(xué)來(lái)的團(tuán)體屬性為Community: 109:1的路由設(shè)置本地優(yōu)先級(jí)為200.

R2#sh ip bgp 192.168.3.0

BGP routing table entry for 192.168.3.0/24, version 4

Paths: (1 available, best #1, table default)

 Not advertised to any peer

 Refresh Epoch 1

 109

   10.1.12.1 from 10.1.12.1 (1.1.1.1)

     Origin IGP, metric 0, localpref 150, valid, external, best

     Community: 109:2

     rx pathid: 0, tx pathid: 0x0

從R1學(xué)來(lái)的團(tuán)體屬性為Community: 109:2的路由設(shè)置本地優(yōu)先級(jí)為150.

沒有被匹配的路由還是以默認(rèn)值傳遞。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

當(dāng)前題目:BGP團(tuán)體屬性(實(shí)驗(yàn))-創(chuàng)新互聯(lián)
轉(zhuǎn)載來(lái)源:http://bm7419.com/article0/cescoo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序品牌網(wǎng)站建設(shè)、做網(wǎng)站、網(wǎng)頁(yè)設(shè)計(jì)公司、商城網(wǎng)站網(wǎng)站建設(shè)

廣告

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

網(wǎng)站優(yōu)化排名