




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、BGP community屬性無敵詳解文檔 (視頻詳解+配套文檔)community屬性是BGP眾多路徑屬性中一個(gè)相對(duì)比較難理解的知識(shí)點(diǎn),需要通過大量實(shí)驗(yàn)加深印象,為了幫助大家更清晰的了解這個(gè)路徑屬性,我特定編寫了這份文檔,希望對(duì)大家有所幫助。本文檔配套詳解視頻:1、community的基本概念 可選傳遞,用于簡化路由策略的執(zhí)行??梢詫⒛承┞酚煞峙湟粋€(gè)特定的COMMUNITY屬性,之后就可以基于COMMUNITY值而不是每條路由進(jìn)行BGP屬性的設(shè)置了。COMMUNITY屬性對(duì)鄰居起作用,在設(shè)置后,同時(shí)需要向鄰居發(fā)送(send community,默認(rèn)是不會(huì)發(fā)送的)。 COMMUNITY屬性是一
2、組4個(gè)8位組的數(shù)值,RFC1997規(guī)定前2B表示AS號(hào),后2B表示基于管理目的設(shè)置的標(biāo)示符,格式為AA:NN,而CISCO默認(rèn)顯示格式為NN:AA(CISCO IOS在顯示community值時(shí),默認(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)顯示的值)。抓個(gè)包看一下: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的這幾個(gè)眾所周知值的本文為原創(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。另外一條路由前綴可以攜帶多個(gè)community形成一個(gè)列表,如果要針對(duì)特定路由在原有的community基礎(chǔ)之上再增加一個(gè)community,則在route-map中set community時(shí),增加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á)式匹配路由。這里有一點(diǎn)需要注意,ip bgp-community new-format用于轉(zhuǎn)換community在CISCO IOS中的顯示格式,當(dāng)在擴(kuò)展的community-list列表中使用正則表達(dá)式的過濾結(jié)果會(huì)由于格式的選擇不同而不同。 ip community-list示例1 在上面實(shí)驗(yàn)的基礎(chǔ)上,R1傳遞給R2的11.11.1
8、1.0/24路由,攜帶了community值100:11,這個(gè)值可以在R2上使用ip community-list進(jìn)行匹配,從而可以進(jìn)一步在route-map中用這個(gè)community-list去設(shè)置策略。我們現(xiàn)在在R2上用community-list 去匹配100:11,通知添加一個(gè)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”,我們做如下測(cè)試:Ip community-list 11 permit 100:11 匹配。這種寫法將匹配co
11、mmunity中包含100:11的路由。Ip community-list 11 permit 100:11 no-advertise 不匹配。這種寫法要求community中同時(shí)包含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):注意我們實(shí)驗(yàn)環(huán)境的變
12、化,12.12.12.0攜帶的community值為no-export,如果我們只希望匹配no-export community值(的路由),那么怎么寫呢?如果是直接去匹配no-export,會(huì)連同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)說了,一條路由,允許攜帶多個(gè)community值,構(gòu)成一個(gè)community列表,那么如果想刪除某個(gè)或者某幾個(gè)community值,例如:12:11 12:1111 no-export 這個(gè)comm列表,要?jiǎng)h除其中的no-export,則可ip community-list 1 permit no-export / 匹配要?jiǎng)h除的commu值route-map test permit 10 set comm-list 1 delete / 用這條命令刪除如果
14、要?jiǎng)h除多個(gè)community(而不是所有),則可在一個(gè)community-list中寫多條,如ip community-list 1 permit no-exportip community-list 1 permit 12:1111然后再用set comm-list 1 delete去刪除,注意上面community-list的寫法,要用多行,在同一行寫多個(gè)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屬性,是個(gè)命令列表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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 出售學(xué)校學(xué)區(qū)房合同范本
- 一建培訓(xùn)合同范本
- 年度供貨合同范本
- 供銷總社采購合同范例
- 勞動(dòng)工人合同范本
- 公司合作簽合同范本
- 中央新風(fēng)合同范本
- 加盟飯店合同范本
- 中介房租合同范本
- app項(xiàng)目轉(zhuǎn)讓合同范本
- 社會(huì)階層與教育選擇行為分析-深度研究
- 社會(huì)工作行政(第三版)課件匯 時(shí)立榮 第6-11章 項(xiàng)目管理- 社會(huì)工作行政的挑戰(zhàn)、變革與數(shù)字化發(fā)展
- 學(xué)校小賣部承包合同范文
- 2025年湘潭醫(yī)衛(wèi)職業(yè)技術(shù)學(xué)院高職單招職業(yè)適應(yīng)性測(cè)試近5年??及鎱⒖碱}庫含答案解析
- 2025年湖南鐵道職業(yè)技術(shù)學(xué)院高職單招職業(yè)技能測(cè)試近5年??及鎱⒖碱}庫含答案解析
- DB 63- T993-2011 三江源生態(tài)監(jiān)測(cè)技術(shù)規(guī)范
- 北京市東城區(qū)2025年公開招考539名社區(qū)工作者高頻重點(diǎn)提升(共500題)附帶答案詳解
- 2025福建福州地鐵集團(tuán)限公司運(yùn)營分公司校園招聘高頻重點(diǎn)提升(共500題)附帶答案詳解
- 2025至2030年中國電子護(hù)眼臺(tái)燈數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 兒童睡眠障礙治療
- 2025年浙江省溫州樂清市融媒體中心招聘4人歷年高頻重點(diǎn)提升(共500題)附帶答案詳解
評(píng)論
0/150
提交評(píng)論