BGPcommunity屬性_第1頁
BGPcommunity屬性_第2頁
BGPcommunity屬性_第3頁
BGPcommunity屬性_第4頁
BGPcommunity屬性_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、BGP community屬性無敵詳解文檔 (視頻詳解+配套文檔)community屬性是BGP眾多路徑屬性中一個相對比較難理解的知識點,需要通過大量實驗加深印象,為了幫助大家更清晰的了解這個路徑屬性,我特定編寫了這份文檔,希望對大家有所幫助。本文檔配套詳解視頻:1、community的基本概念 可選傳遞,用于簡化路由策略的執(zhí)行??梢詫⒛承┞酚煞峙湟粋€特定的COMMUNITY屬性,之后就可以基于COMMUNITY值而不是每條路由進(jìn)行BGP屬性的設(shè)置了。COMMUNITY屬性對鄰居起作用,在設(shè)置后,同時需要向鄰居發(fā)送(send community,默認(rèn)是不會發(fā)送的)。 COMMUNITY屬性是一

2、組4個8位組的數(shù)值,RFC1997規(guī)定前2B表示AS號,后2B表示基于管理目的設(shè)置的標(biāo)示符,格式為AA:NN,而CISCO默認(rèn)顯示格式為NN:AA(CISCO IOS在顯示community值時,默認(rèn)是按10進(jìn)制格式顯示),可使用全局配置命令ip bgpcommunity new-format將CISCO默認(rèn)格式改為RFC格式。 例如將AS12的某條路由COMM值改為10000,RFC采用十六進(jìn)制表示COMMUNITY屬性,而CISCO采用十進(jìn)制。RFC格式為12:10000,十六進(jìn)制為0x 000C2710,再轉(zhuǎn)換為十進(jìn)制796432(這就是CISCO IOS默認(rèn)顯示的值)。抓個包看一下:2

3、、在route-map中設(shè)置community屬性route-map test permit 10 set community ? community number aa:nn community number in aa:nn format additive Add to the existing community 設(shè)置commu值為附加,否則為覆蓋 internet Internet (well-known community) 默認(rèn)所有路由都屬于該團(tuán)體 local-AS Do not send outside local AS (well-known community) no-adv

4、ertise Do not advertise to any peer (well-known community) no-export Do not export to next AS (well-known community) none No community attribute下邊我們來看一下community的這幾個眾所周知值的本文為原創(chuàng)博文,no-advertiseno-exportlocal-as配置示例(使用route-map為路由分配community):在R1上為路由11.11.11.0/24分配community 100:11,并且傳遞給R2,那么R1上配置如下:ip

5、prefix-list 11 permit 11.11.11.0/24route-map test permit 10 match ip address prefix-list 11 set community 100:11router bgp 100 network 11.11.11.0 mask 255.255.255.0 neighbor 10.1.12.2 remote-as 200 neighbor 10.1.12.2 send-community / 默認(rèn)community不發(fā)送,因此必須配置該命令 neighbor 10.1.12.2 route-map test out注意co

6、mmunity默認(rèn)不發(fā)送,必須send-community。另外一條路由前綴可以攜帶多個community形成一個列表,如果要針對特定路由在原有的community基礎(chǔ)之上再增加一個community,則在route-map中set community時,增加additive關(guān)鍵字。3、使用ip community-list匹配community值 ip community-list ? Community list number (standard) Community list number (expanded) expanded Add an expanded community-lis

7、t entry standard Add a standard community-list entryip community-list 也像ACL那樣,有標(biāo)準(zhǔn)和擴(kuò)展之分,1-99為標(biāo)準(zhǔn),100-199為擴(kuò)展。擴(kuò)展的community-list 可以使用正則表達(dá)式匹配路由。這里有一點需要注意,ip bgp-community new-format用于轉(zhuǎn)換community在CISCO IOS中的顯示格式,當(dāng)在擴(kuò)展的community-list列表中使用正則表達(dá)式的過濾結(jié)果會由于格式的選擇不同而不同。 ip community-list示例1 在上面實驗的基礎(chǔ)上,R1傳遞給R2的11.11.1

8、1.0/24路由,攜帶了community值100:11,這個值可以在R2上使用ip community-list進(jìn)行匹配,從而可以進(jìn)一步在route-map中用這個community-list去設(shè)置策略。我們現(xiàn)在在R2上用community-list 去匹配100:11,通知添加一個no-export的community到該路由。R2的配置如下:ip community-list 11 permit 100:11route-map test permit 10 match community 11 set community no-export additiverouter bgp 200

9、neighbor 10.1.12.1 remote-as 100 neighbor 10.1.23.3 remote-as 300 neighbor 10.1.23.3 send-community neighbor 10.1.23.3 route-map test outR3上show ip bgp 11.11.11.0BGP routing table entry for 11.11.11.0/24, version 5Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP p

10、eer)Flag: 0x820 Not advertised to any peer 200 100 10.1.23.2 from 10.1.23.2 (10.1.23.2) Origin IGP, localpref 100, valid, external, best Community: 100:11 no-export ip community-list的示例2(邏輯關(guān)系):當(dāng)11.11.11.0/24路由前綴攜帶的community屬性為“100:11 no-export”,我們做如下測試:Ip community-list 11 permit 100:11 匹配。這種寫法將匹配co

11、mmunity中包含100:11的路由。Ip community-list 11 permit 100:11 no-advertise 不匹配。這種寫法要求community中同時包含100:11及no-advertise才匹配成立。Ip community-list 11 permit 100:11Ip community-list 11 permit no-export (或?qū)o-export換成no-adv)匹配。這種寫法只要community中包含100:11或no-export就匹配成立 ip community-list的示例3(嚴(yán)格匹配community):注意我們實驗環(huán)境的變

12、化,12.12.12.0攜帶的community值為no-export,如果我們只希望匹配no-export community值(的路由),那么怎么寫呢?如果是直接去匹配no-export,會連同11.11.11.0也一并匹配上了,所以就要使用到exact-match關(guān)鍵字了。在R3上如果配置如下:Ip community-list 11 permit no-exportroute-map test permit 10 match community 11 exact-match / 嚴(yán)格匹配如果不加exact-match關(guān)鍵字,則該community-list將匹配11及12路由,加了之后

13、,則只匹配community為no-export的路由,不能多,不能少。4、在community列表中刪除特定的community值前面已經(jīng)說了,一條路由,允許攜帶多個community值,構(gòu)成一個community列表,那么如果想刪除某個或者某幾個community值,例如:12:11 12:1111 no-export 這個comm列表,要刪除其中的no-export,則可ip community-list 1 permit no-export / 匹配要刪除的commu值route-map test permit 10 set comm-list 1 delete / 用這條命令刪除如果

14、要刪除多個community(而不是所有),則可在一個community-list中寫多條,如ip community-list 1 permit no-exportip community-list 1 permit 12:1111然后再用set comm-list 1 delete去刪除,注意上面community-list的寫法,要用多行,在同一行寫多個commu如ip community-list 1 permit no-export 12:1111則不生效。R3收到兩條路由,分別攜帶的community屬性如上,現(xiàn)在,我們只想刪除11路由的no-export屬性。ip community-list 11 permit 100:11 no-export /這條用來匹配11路由ip community-list standard del permit no-export /這條用來刪除no-export屬性,是個命令列表route-map test permit 10 match community 11 set metric 1111 set comm-list del deleteroute-map test permit 20router bg

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論