




下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
24通常可以將路由協(xié)議分為IGP(內(nèi)部網(wǎng)關(guān)協(xié)議)和EGP(外部網(wǎng)關(guān)協(xié)議。EGP主要用于ISP之間交換路由信息。目前使用最為廣泛的EGP是BGP版本4,它是第一個(gè)支持CIDR和路由匯總的BGP版本。RFC1772對(duì)BGP有詳細(xì)的定義。BGPBGP特征VLSM(peer配,范圍為1-65535,其中64512-65535是私有使用的;BGP(IBGP;BGP(EBGPBGP屬性O(shè)RIGIN():這個(gè)屬性說明了源路由是怎樣放到BGP表中的。有三個(gè)可能的源:IGP,EGPPLETE。路由器在多個(gè)路由選擇的處理中使用這個(gè)信息。路由器選ORIGINORIGINIGP<EGP<PLETE;AS_PATH(AS路徑):包含在UPDATE報(bào)文中的路由信息所經(jīng)過的自治系統(tǒng)的Next_HOP(下一跳) 路由器所獲得的BGP路由的下一跳。對(duì)EBGP會(huì)話來說它的下一跳會(huì)不變的帶入IBGP中;公認(rèn)自決(Well-KnownDiscretionary):指必須被所有BGP實(shí)現(xiàn)所識(shí)別,但是在BGP更文中可以發(fā)送,也可以不發(fā)送的屬性,包括LOCAL_PREF和ATOMIC_AGGREGATE在IBGP鄰居之間傳遞;ATOMIC_AGGREGATE(原子聚合):原子聚合屬性已被丟失了的信息。當(dāng)路可選過渡(OptionalTransitive)BGP持。如果該屬性不能被BGP進(jìn)程識(shí)別,它就會(huì)去看過渡標(biāo)志。如果過渡標(biāo)志被設(shè)置了,BGP進(jìn)程會(huì)接受這個(gè)屬性并將它不加改變的傳送,包括AGGREGATOR和COMMUNITY。AGGREGATOR(聚合者)BGPID由的路由器的AS號(hào);COMMUNITY(團(tuán)體):此屬性指共個(gè)公共屬性的一組路由器可選非過渡(OptionalNontransitive):可選非過渡屬性并不要求所有的BGP實(shí)現(xiàn)BGP鄰居,包括MED、ORIGINATOR_IDCLUSTER_LIST。MED(多出口區(qū)分):該屬性通知AS外的路由器采用哪一條路徑到達(dá)AS。它也被認(rèn)為是路由的外部度量,低的MED值表示高的優(yōu)先級(jí)。MED屬性在自治系統(tǒng)間交換,但MED屬性不能傳遞到第AS;由器的路由器ID,用以防止環(huán)路;CLUSTER_LIST(簇列表)BGP路由判按優(yōu)先順序給出了路由器在BGP路徑選擇中的判定過程:如果本地優(yōu)先級(jí)相同,優(yōu)先選取源自于本路由器(即下一跳為“0.0.0.0”)上如果具有相同的AS路徑長(zhǎng)度,優(yōu)先選取有最低代碼(IGP<EGP< EBGP路由實(shí)驗(yàn)1:IBGPEBGP基本配置24-1IBGPEBGP因?yàn)楸緦?shí)驗(yàn)中IBGP的路由器(R1,R2和R3)形成全互聯(lián)(FULLMESH)的鄰居關(guān)系,所以路由器R1、R2和R3均關(guān)閉同步。IBGP路由器之間運(yùn)行的IGP是EIGRP,為了提供BGP建立鄰居關(guān)系的TCP連接和BGP下一跳可達(dá)。R1(config)#routereigrpR1(config-router)#network1.1.1.0R1(config-router)#network12.12.12.0255.255.255.0R1(config-router)#noauto-summaryR1(config)#routerbgp100 //啟動(dòng)BGP進(jìn)程R1(config-router)#nosynchronization R1(config-router)#bgprouter-id1.1.1.1//配置BGP路由器IDR1(config-router)#neighbor2.2.2.2update-sourceLoopback0//指定更新源R1(config-router)#neighbor3.3.3.3remote-as100R1(config-router)#neighbor3.3.3.3update-sourceLoopback0R1(config-router)#network1.1.1.0mask255.255.255.0//通告網(wǎng)絡(luò)R1(config-router)#noauto-summary R2(config)#routereigrpR2(config-router)#network2.2.2.0R2(config-router)#network23.23.23.0255.255.255.0R2(config-router)#noauto-summaryR2(config)#routerbgp100R2(config-router)#nosynchronizationR2(config-router)#bgprouter-id2.2.2.2R2(config-router)#neighbor1.1.1.1remote-asR2(config-router)#neighbor1.1.1.1update-sourceLoopback0R2(config-router)#neighbor3.3.3.3remote-as100R2(config-router)#neighbor3.3.3.3update-sourceLoopback0R2(config-router)#noauto-summaryR3(config)#routereigrpR3(config-router)#network3.3.3.0R3(config-router)#network23.23.23.0255.255.255.0R3(config-router)#noauto-summaryR3(config)#routerbgp100R3(config-router)#nosynchronizationR3(config-router)#bgprouter-id3.3.3.3R3(config-router)#neighbor1.1.1.1remote-asR3(config-router)#neighbor1.1.1.1update-sourceLoopback0R3(config-router)#neighbor1.1.1.1next-hop-self通告自己是發(fā)送BGP更新的下一跳,而不是EBGP鄰居R3(config-router)#neighbor2.2.2.2remote-asR3(config-router)#neighbor2.2.2.2update-sourceLoopback0R3(config-router)#neighbor2.2.2.2next-hop-selfR3(config-router)#neighbor34.34.34.4remote-as200R3(config-router)#noauto-summaryR4(config)#routerbgpR4(config-router)#nosynchronizationR4(config-router)#bgprouter-id4.4.4.4R4(config-router)#neighbor34.34.34.3remote-as100R4(config-router)#noauto-summaryR4(config)#iproute4.4.0.0255.255.252.0命令“neighbor”后邊跟的是鄰居路由器BGPBGPnetworkIGPIGP(可以是直連、靜態(tài)路由或動(dòng)態(tài)路由)在BGPnetworkmask”來通BGPIGPnetworkBGP在命令“neighborupdate-source”參數(shù),是用來指定更新源的。如TCPBGPBGP的穩(wěn)健性;在命令“neighbornext-hop-self”參數(shù)是為了解決下一跳可達(dá)的問4.實(shí)驗(yàn)調(diào)(1)showtcp。R3#showtcp LocalForeign64752BAC64753B5C以上輸出標(biāo)明路由器R3和路由器R1、R2和R4的179端口建立了TCP連接。建立TCP連接的雙方使用BGP路由更新源的地址。只要兩臺(tái)路由器之間建立了一條TCP連接,就可以形成BGP鄰居關(guān)系。showipbgpR3#showipbgpneighborsBGPneighboris34.34.34.4,remoteAS200,externallinkBGPversion4,remoterouterID4.4.4.4BGPstate=Established,upforLastread00:00:21,holdtimeis180,keepaliveintervalis60NeighborRouterefresh:advertisedandreceived(old&new)AddressfamilyIPv4Unicast:advertisedandreceived的路由器ID號(hào)是4.4.4.4。命令“showipbgpneighbors”顯示出的信息最重要的一部分等體間的會(huì)話是打開的并正在運(yùn)行。如果顯示的是其它狀態(tài)Idle、Connect、ActiveOpenSent或OpenConfirm,那就存在問題。showipbgpR3#showipbgpBGProuteridentifier3.3.3.3,localASnumber//路由器ID及本地BGPtableversionis11,mainroutingtableversion5networkentriesusing505bytesofmemory//網(wǎng)絡(luò)條目和使用的5pathentriesusing240bytesof//路徑條目和使用的2BGPpathattributeentriesusing120bytesofmemory1BGPAS-PATHentriesusing24bytesofmemory0BGProute-mapcacheentriesusing0bytesofmemory0BGPfilter-listcacheentriesusing0bytesofmemoryBGPusing889totalbytesofmemoryBGPactivity5/0prefixes,6/1paths,scaninterval60 VASMsgRcvd TblVerInQOutQUp/Down00140004004MsgRcvdMsgSent:Up/Down:showipR3#showipBGPtableversionis11,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight00*>00200*>00200*>00200*>00200*>00200s*:以上輸出中,代碼(Origincodes)的含釋如下下面具體地解釋BGP路由條目 0i①r:因?yàn)槁酚善鱎3通過EIGRP學(xué)到“1.1.1.0/24”路由條目,其管理距離為90,而通過IBGP學(xué)到“1.1.1.0/24”路由條目的管理距離是200,而且關(guān)閉了同步,BGP表中的路IP路由表中失敗,所以出現(xiàn)代碼“r”;值是32768;如果是從鄰居學(xué)來的,默認(rèn)權(quán)重值為0;showipR1#showipCodes:C-connected,S-static,R-RIP,M-mobile,B-D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinter*-candidatedefault,U-per-userstaticroute,o-ODRP-periodicdownloadedstaticrouteGatewayoflastresortisnot1.0.0.0/24issubnetted,1 1.1.1.0isdirectlyconnected,Loopback02.0.0.0/24issubnetted,1subnets2.2.2.0 ]via12.12.12.2,03:03:44,3.0.0.0/24issubnetted,1 3.3.3.0 ]via12.12.12.2,03:03:44,4.0.0.0/8isvariablysubnetted,5subnets,2masks 4.4.0.0/24[200/0]via3.3.3.3,03:02:52 4.4.0.0/22[200/0]via3.3.3.3, 4.4.1.0/24[200/0]via3.3.3.3, 4.4.2.0/24[200/0]via3.3.3.3, 4.4.3.0/24[200/0]via3.3.3.3,23.0.0.0/24issubnetted,1 23.23.23.0 ]via12.12.12.2,03:03:45,12.0.0.0/24issubnetted,112.12.12.0isdirectlyconnected,Serial0/0/0R3#showiprouteCodes:C-connected,S-static,R-RIP,M-mobile,B--EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinter*-candidatedefault,U-per-userstaticroute,o-ODRP-periodicdownloadedstaticrouteGatewayoflastresortisnot34.0.0.0/24issubnetted,1 34.34.34.0isdirectlyconnected,Serial0/0/01.0.0.0/24issubnetted,1subnets1.1.1.0 ]via23.23.23.2,02:17:48,2.0.0.0/24issubnetted,1 2.2.2.0 ]via23.23.23.2,02:51:36,3.0.0.0/24issubnetted,1 3.3.3.0isdirectlyconnected,Loopback04.0.0.0/8isvariablysubnetted,5subnets,2masks 4.4.0.0/24[20/0]via34.34.34.4, 4.4.0.0/22[20/0]via34.34.34.4, 4.4.1.0/24[20/0]via34.34.34.4, 4.4.2.0/24[20/0]via34.34.34.4, 4.4.3.0/24[20/0]via34.34.34.4,23.0.0.0/24issubnetted,1 23.23.23.0isdirectlyconnected,Serial0/0/112.0.0.0/24issubnetted,1subnets12.12.12.0 ]via23.23.23.2,02:17:53,在路由器R1上4.4.0.4,結(jié)果是不通的,原因很簡(jiǎn)單,就是路由器R1和R2的路由表中沒有34.34.34.0的路由,此時(shí)如果執(zhí)行擴(kuò)展,就是通的:ProtocolTargetIPaddress:4.4.0.4Repeatcount[5]:2DatagramsizeTimeoutinsecondsExtendedcommands[n]:Sourceaddressorinterface:1.1.1.1Typeofservice[0]:SetDFbitinIPheader?Validatereplydata?DatapatternLoose,Strict,Record,Timestamp,SweeprangeofsizesTypeescapesequencetoSending2,100-byteICMPEchosto4.4.0.4,timeoutis2seconds:Packetsentwithasourceaddressof1.1.1.1方法很多,比如在路由器R3上重分布直連。R1(config)#routerbgp R1#clearipbgp*BGPR1#showipBGPtableversionis1,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*00200*00200*00200*00200*00200器R2和R3建立鄰居關(guān)系,操作如下:R1(config)#routerbgpR1(config-router)#nosynchronizationR1(config-router)#noneighborR3(config)#routerbgpR3(config-router)#noneighbor1.1.1.1在路由器R1R2BGP表:R1#showipbgpBGPtableversionis2,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*> 32768R2#showipBGPtableversionis8,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight000020000200002000020000200以上輸出表明路由器R2并沒有將路由器R3通告的路由通告給路由器R1,這也進(jìn)一步驗(yàn)證了IBGP水平分割的基本原理:通過IBGP學(xué)到的路由不能通告給相同AS內(nèi)的其它的IBGP鄰居。通常的解決辦法有兩個(gè):IBGP形成全互聯(lián)鄰居關(guān)系或使用路由反射器。實(shí)驗(yàn)2:BGP地址聚合,并通告給路由器R4。在路由器R1、R3、R4配置靜態(tài)路由實(shí)現(xiàn)網(wǎng)絡(luò)互通。R1(config)#routerbgpR1(config-router)#nosynchronizationR1(config-router)#noauto-summaryR1(config-router)#bgprouter-id1.1.1.1R1(config-router)#neighbor12.12.12.2remote-asR1(config-router)#network1.1.0.0maskR1(config-router)#network1.1.1.0maskR1(config)#iproute24.24.24.0255.255.255.0R1(config)#iproute23.23.23.0255.255.255.0R2(config)#routerbgpR2(config-router)#nosynchronizationR2(config-router)#noauto-summaryR2(config-router)#bgprouter-id2.2.2.2remote-remote-remote-R3(config)#routerbgpR3(config-router)#nosynchronizationR3(config-router)#noauto-summaryR3(config-router)#bgprouter-id3.3.3.3R3(config-router)#neighbor23.23.23.2remote-asR3(config-router)#network1.1.2.0maskR3(config-router)#network1.1.3.0maskR3(config)#iproute12.12.12.0255.255.255.0R3(config)#iproute24.24.24.0255.255.255.0R4(config)#routerbgpR4(config-router)#nosynchronizationR4(config-router)#noauto-summaryR4(config-router)#bgprouter-id4.4.4.4R4(config-router)#neighbor24.24.24.2remote-asR4(config-router)#network4.4.4.0maskR4(config)#iproute12.12.12.0255.255.255.0R4(config)#iproute23.23.23.0255.255.255.0實(shí)驗(yàn)調(diào)R1#showipBGPtableversionis21,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*>032768*>00200*>032768*>0200300*>0200300*>0200400R4#showipBGPtableversionis45,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? NextMetricLocPrfWeight*>0200100*>00200*>0200100*>0200300*>0200300*> 32768①路由器R1、R4收到“1.1.0.0/22”聚合路由,通過AS-PATH屬性可以看出,執(zhí)行地址聚合的路由器R2AS-PATH屬性丟失;②R44明細(xì)路由,在AS-PATH列中,路由的AS列表的末端(右側(cè)ASBGPAS追加在列表的開頭(左側(cè);環(huán)路,在路由器R2上操作如下:R1、R4BGPR1#showipBGPtableversionis22,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*>032768*>032768*>0200300*>0200300*>0200400R4#showipBGPtableversionis56,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? NextMetricLocPrfWeight*>0200100*>00200{100,300}*>0200100*>0200300*>0200300*>032768的AS號(hào)碼的集合“{100300}”;在路由器R3BGP表中也不會(huì)出現(xiàn)。BGP使用AS-PATH屬性作為路由更新的一部分來確保沒有路由環(huán)路。因?yàn)樵贐GP對(duì)等體之間傳遞的每條路由都攜帶它所經(jīng)過的AS號(hào)碼序列表,如果該路由被通告給它始發(fā)的AS,該AS路由器將在AS序列表中看到自己的AS,它將不接受該路由。以下的輸出充分的說明R2#showipbgpneighbor12.12.12.1advertised-routesBGPtableversionis8,localrouterIDis2.2.2.2Statuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,?- Next MetricLocPrfWeight*>32768{100,300}*>00300*>00300*>00400以上輸出表明路由R2仍然12.12.12.1發(fā)送聚合路由“1.1.0.0/22R1#showipbgpneighbors12.12.12.2received-routesBGPtableversionis22,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? NextMetricLocPrfWeight*>0200300*>0200300*>0200400以上輸出表明路由器R1沒有接收聚合路由“1.1.00/22”,因?yàn)樗l(fā)現(xiàn)聚合路由條目中的AS-PATH屬性列表“{100,300}”中包含自己的AS號(hào)碼100,所以不接收。同理,路由器R3要執(zhí)行“showipbgpneighbors12.12.12.2received-routes”命令,必須完成下R1(config-router)#neighbor12.12.12.2soft-reconfiguration如果在路由器R4上只想看到匯總路由,沒有明細(xì)路由,“summary-only”參數(shù)可以實(shí)現(xiàn),在路由器R2上的配置如下;R2(config-router)#aggregate-address1.1.0.0255.255.252.0as-setsummary-R2、R4上查看BGPR2#showipBGPtableversionis14,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeights>00100*>32768{100,300}s>00100s>00300s>00300*>00400R4#showipBGPtableversionis62,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*> 0200{100,300}*>
32768R41.1.0.0/22”。如果不加“as-set”參數(shù),則路由器R1、R3也會(huì)收到該聚合路由。可以完成。本實(shí)驗(yàn)要求路由器R2地址聚合后,要求路由器R1的兩條明細(xì)路由被抑制,而路R3R4,R2R2(config)#ipprefix-list1permit1.1.0.0/24//匹配路由條目,以便進(jìn)行控制R2(config)#ipprefix-list1permit1.1.1.0/24R2(config)#route-mapsuppermitR2(config-route-map)#matchipaddressprefix-list1R2(config)#routerbgp200 suppress-mapsupR1#showipBGPtableversionis28,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*>032768*>032768*>0200300*>0200300*> 0200400R2#showipBGPtableversionis20,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeights>00100*>32768{100,300}s>00100*>00300*>00300*>R3#showip00400BGPtableversionis58,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*>032768*>032768*>0200400R4#showipBGPtableversionis64,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*>00200{100,300}*>0200300*>0200300*>032768所以路由器R3和R4不能收到;R21.1.2.0/24”和“1.1.3.0/24”抑制,又沒③由于配置了“as-set”參數(shù),所以只有R4收到匯總路由“1.1.0.0/22用BGP屬性控制選BGPORIGIN、AS-PATH、LOCAL_PREF、WEIGHTMED圖24-3所示。通過修改ORIGIN、AS-PATH、LOCAL_PREF、WEIGHT屬性來控制在AS100內(nèi)路由器R1、R2和R3對(duì)路由器R4上通告的4.4.4.0/24路由的選路。最后通過在路由器R2和R3上發(fā)布環(huán)回接口來控制從路由器R4進(jìn)入AS100的選路。本實(shí)驗(yàn)中IBGP的路由器(R1、R2和R3)形成全互聯(lián)(FULLMESH)的鄰居關(guān)系。IGP運(yùn)行EIGRP。在完成每個(gè)分解實(shí)驗(yàn)后,最好用“clearipbgp*”清除一下BGP路由表,然后再查看結(jié)果。實(shí)驗(yàn)3:用BGPORIGIN屬性控制選路本實(shí)驗(yàn)是在路由器R4上配置“4.4.4.0/24”的代碼屬性為EGP,并通過EBGP鄰居“14.14.14.1”傳入AS100內(nèi),然后觀察路由器R1、R2和R3對(duì)路由器R4上通告的R1(config)#routereigrpR1(config-router)#network1.1.1.0R1(config-router)#network12.12.12.0255.255.255.0R1(config-router)#noauto-summaryR1(config)#routerbgpR1(config-router)#nosynchronizationR1(config-router)#noauto-summaryR1(config-router)#bgprouter-id1.1.1.1R1(config-router)#neighbor2.2.2.2remote-asR1(config-router)#neighbor2.2.2.2update-sourceLoopback0R1(config-router)#neighbor2.2.2.2next-hop-selfR1(config-router)#neighbor3.3.3.3remote-asR1(config-router)#neighbor3.3.3.3update-sourceLoopback0R1(config-router)#neighbor3.3.3.3next-hop-selfR1(config-router)#neighbor14.14.14.4remote-asR2(config)#routereigrp2.2.2.012.12.12.023.23.23.0R2(config)#routerbgp100R2(config-router)#nosynchronizationR2(config-router)#noauto-summaryR2(config-router)#bgprouter-id2.2.2.2R2(config-router)#neighbor1.1.1.1remote-asR2(config-router)#neighbor1.1.1.1update-sourceLoopback0R2(config-router)#neighbor3.3.3.3remote-as100R2(config-router)#neighbor3.3.3.3update-sourceLoopback0R3(config)#routereigrpR3(config-router)#network3.3.3.0R3(config-router)#network23.23.23.0255.255.255.0R3(config-router)#noauto-summaryR3(config)#routerbgp100R3(config-router)#nosynchronizationR3(config-router)#noauto-summaryR3(config-router)#bgprouter-id3.3.3.3R3(config-router)#neighbor1.1.1.1remote-asR3(config-router)#neighbor1.1.1.1update-sourceLoopback0R3(config-router)#neighbor1.1.1.1next-hop-selfR3(config-router)#neighbor2.2.2.2remote-asR3(config-router)#neighbor2.2.2.2update-sourceLoopback0R3(config-router)#neighbor2.2.2.2next-hop-selfR3(config-router)#neighbor34.34.34.4remote-asR4(config-router)#ipprefix-list1permit4.4.4.0/24R4(config)#route-mapegppermit10R4(config-route-map)#matchipaddressprefix-list1R4(config-route-map)#setoriginegp900 R4(config)#routerbgp200R4(config-router)#nosynchronizationR4(config-router)#noauto-summaryR4(config-router)#bgprouter-id4.4.4.4R4(config-router)#network4.4.4.0maskR4(config-router)#neighbor14.14.14.1remote-as100R4(config-router)#neighbor14.14.14.1route-mapegpoutR4(config-router)#neighbor34.34.34.3remote-as實(shí)驗(yàn)調(diào)R1#showipBGPtableversionis6,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight00200*00200R2#showipBGPtableversionis5,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight00200R3#showipBGPtableversionis4,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*> 0200實(shí)驗(yàn)4:用BGPAS-PATH屬性控制選R4(config)#ipprefix-list1permit4.4.4.0/24R4(config)#route-mapaspathpermit10R4(config-route-map)#matchipaddressprefix-listR4(config-route-map)#setas-pathprepend600700ASR4(config)#routerbgp200R4(config-router)#neighbor34.34.34.3route-mapaspath實(shí)驗(yàn)調(diào)R1#showipBGPtableversionis11,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*> 0200R2#showipBGPtableversionis9,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight 0200R3#showipBGPtableversionis9,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight00200*00200600700以上輸出表明路由器R3學(xué)到兩條關(guān)于“4.4.4.0/24”的路由,但是由于下一跳為“*”)不能繼續(xù)通告R1和R2,所以路由器R1和R2只有一條關(guān)于“4.4.4.0/24”BGPAS-PATHORIGIN實(shí)驗(yàn)5:用BGPLOCAL_PREF屬性控制選路R3(config)#ipprefix-list1permit4.4.4.0/24R3(config)#route-maplocalpermit10R3(config-route-map)#matchipaddressprefix-listR3(config-router)#neighbor34.34.34.4route-maplocal實(shí)驗(yàn)調(diào)R1#showipBGPtableversionis2,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*0020000200600700R2#showipBGPtableversionis2,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight00200600700R3#showipBGPtableversionis2,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*> 0200600700以上輸出表明路由器R1學(xué)到兩條關(guān)于“4.4.4.0/24”的路由,但是由于下一跳為命令“bgpdefaultlocal-preference”也可以修改本地優(yōu)先級(jí)屬性,只是說用route-map設(shè)置本地優(yōu)先級(jí)靈活性更大。實(shí)驗(yàn)6:用BGPWEIGHT屬性控制選路R1(config)#routerbgpR1(config-router)#neighbor2.2.2.2weightR1(config-router)#neighbor3.3.3.3weightR1(config-router)#neighbor14.14.14.4weight實(shí)驗(yàn)調(diào)R1#showipBGPtableversionis3,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*>0500200*0200200600700R2#showipBGPtableversionis2,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*0020000200600700R3#showipBGPtableversionis2,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*0020000200600700以上輸出表明路由器R1學(xué)到兩條關(guān)于“4.4.4.0/24”的路由,但是由于下一跳為R2R3R1BGPweight屬實(shí)驗(yàn)7:用MED屬性控制選問20.1.1.2的時(shí)候走R4→R1→R2→R1→R4的路徑。R1(config)#ipprefix-list20permit20.1.1.0/24R1(config)#ipprefix-list30permit30.1.1.0/24R1(config)#route-mapmedpermit10R1(config-route-map)#matchipaddressprefix-list20R1(config-route-map)#setmetric50 //設(shè)置MED值R1(config)#route-mapmedpermit20R1(config-route-map)#matchipaddressprefix-list30R1(config-route-map)#setmetric100R1(config)#route-mapmedpermit30R1(config-router)#neighbor14.14.14.4route-mapmed步驟2:配置路由器R2R2(config-if)#routerbgp100R2(config-router)#network20.1.1.0maskR3(config)#ipprefix-list20permit20.1.1.0/24R3(config)#ipprefix-list30permit30.1.1.0/24R3(config)#route-mapmedpermit10R3(config-route-map)#matchipaddressprefix-list20R3(config-route-map)#setmetric100R3(config)#route-mapmedpermit20R3(config-route-map)#matchipaddressprefix-list30R3(config-route-map)#setmetric50R3(config)#route-mapmedpermit30R3(config)#routerbgp100R3(config-router)#network30.1.1.0mask255.255.255.0R3(config-router)#neighbor34.34.34.4route-mapmedout實(shí)驗(yàn)調(diào)R4#showipBGPtableversionis5,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*>032768*01000100*>0100*0100用擴(kuò)展路徑ProtocolTargetIPaddress:20.1.1.2Repeatcount[5]:1DatagramsizeTimeoutinsecondsExtendedcommands[n]:Sourceaddressorinterface:4.4.4.4Typeofservice[0]:SetDFbitinIPheader?Validatereplydata?DatapatternLoose,Strict,Record,Timestamp,Verbose[none]:RNumberofhops[9]:6Loose,Strict,Record,Timestamp,SweeprangeofsizesTypeescapesequencetoSending1,100-byteICMPEchosto20.1.1.2,timeoutis2seconds:Packetsentwithasourceaddressof4.4.4.4PackethasIPoptions:Totaloptionbytes=27,paddedlength=28Recordroute:<*>Replytorequest0(148ms).ReceivedpackethasoptionsTotaloptionbytes=28,paddedlength=28RecordEndofProtocolTargetIPaddress:30.1.1.3Repeatcount[5]:1Datagramsize[100]:Timeoutinseconds[2]:Extendedcommands[n]:Sourceaddressorinterface:4.4.4.4Typeofservice[0]:SetDFbitinIPheader?Validatereplydata?DatapatternLoose,Strict,Record,Timestamp,Verbose[none]:RNumberofhops[9]:4Loose,Strict,Record,Timestamp,SweeprangeofsizesTypeescapesequencetoSending1,100-byteICMPEchosto30.1.1.3,timeoutis2seconds:Packetsentwithasourceaddressof4.4.4.4PackethasIPoptions:Totaloptionbytes=19,paddedlength=20Recordroute:<*>Replytorequest0(248ms).ReceivedpackethasoptionsTotaloptionbytes=20,paddedlength=20RecordEndofR1(config)#routereigrpR1(config-router)#network1.1.1.0R1(config-router)#network12.12.12.0255.255.255.0R1(config-router)#noauto-summaryR1(config)#routerbgp100R1(config-router)#nosynchronizationR1(config-router)#noauto-summaryR1(config-router)#bgprouter-id1.1.1.1R1(config-router)#neighbor2.2.2.2remote-as100R1(config-router)#neighbor2.2.2.2update-sourceLoopback0R1(config-router)#network1.1.1.0mask255.255.255.0R2(config)#routereigrpR2(config-router)#noauto-summaryR2(config)#routerbgp100R2(config-router)#noR2(config-router)#noauto-summaryR2(config-router)#bgprouter-id2.2.2.2R2(config-router)#neighbor1.1.1.1remote-as100R2(config-router)#neighbor1.1.1.1update-sourceLoopback0R2(config-router)#neighbor3.3.3.3remote-asR2(config-router)#neighbor3.3.3.3update-sourceLoopback0R2(config-router)#neighbor3.3.3.3route-reflector-clientR3(config)#routereigrpR3(config-router)#network3.3.3.0R3(config-router)#network23.23.23.0255.255.255.0R3(config-router)#noauto-summaryR3(config)#routerbgp100R3(config-router)#nosynchronizationR3(config-router)#noauto-summaryR3(config-router)#bgprouter-id3.3.3.3R3(config-router)#neighbor2.2.2.2remote-asR3(config-router)#neighbor2.2.2.2update-sourceLoopback0R3(config-router)#neighbor2.2.2.2next-hop-selfR3(config-router)#neighbor34.34.34.4remote-asR4(config)#routerbgpR4(config-router)#nosynchronizationR4(config-router)#noauto-summaryR4(config-router)#bgprouter-id4.4.4.4R4(config-router)#neighbor34.34.34.3remote-asR4(config-router)#network4.4.4.0maskASIBGPIBGP路由反射器是克服IBGP水平分割的重要。;實(shí)驗(yàn)調(diào)showipbgpR2#showipbgpneighborsBGPneighboris1.1.1.1,remoteAS100,internallinkBGPversion4,remoterouterID1.1.1.1BGPstate=Established,upforLastread00:00:07,holdtimeis180,keepaliveintervalis60Foraddressfamily:IPv4BGPtableversion4,neighborversion4Index1,Offset0,Mask0x2Route-ReflectorshowipR2#showipbgpBGProutingtableentryfor4.4.4.0/24,versionPaths:(1available,best#1,tableDefault-IP-Routing-Table)Advertisedtononpeer-grouppeers:200,(ReceivedfromaRR-3.3.3.3 )from3.3.3.3OriginIGP,metric0,localpref100,valid,internal,并且將它反射給1.1.1.1。注意上面輸出中“(3.3.3.3)”指的是路由器ID。R1#showipbgpBGProutingtableentryfor4.4.4.0/24,versionPaths:(1available,best#1,tableDefault-IP-Routing-Table)Notadvertisedtoanypeer3.3.3.3 )from2.2.2.2OriginIGP,metric0,localpref100,valid,internal,bestOriginator:3.3.3.3,Clusterlist:2.2.2.2它檢查CLUSTER_LIST,如果發(fā)現(xiàn)在列表中有自己的簇ID,就知道出現(xiàn)了路由環(huán)路。實(shí)驗(yàn)9:BGP配步驟1:配置路由器R1R1(config)#routerbgp65001R1(config-router)#noauto-summaryR1(config-router)#bgprouter-idR1(config-router)#bgpconfederationidentifier100//配置IDR1(config-router)#bgpconfederationpeers65002//EBGP對(duì)等的成員R1(config-router)#network1.1.1.0mask255.255.255.0R1(config-router)#neighbor12.12.12.2remote-asR1(config-router)#neighbor13.13.13.3remote-asR1(config-router)#neighbor13.13.13.3next-hop-R2(config)#routerbgpR2(config-router)#nosynchronizationR2(config-router)#noauto-summaryR2(config-router)#bgprouter-id2.2.2.2R2(config-router)#network2.2.2.0maskR2(config-router)#neighbor12.12.12.1remote-asR2(config-router)#neighbor23.23.23.3remote-asR3(config)#routereigrpR3(config-router)#network3.3.3.0R3(config-router)#network34.34.34.00.0.0.255R3(config-router)#noauto-summaryR3(config)#routerbgp65002R3(config-router)#nosynchronizationR3(config-router)#noauto-summaryR3(config-router)#bgprouter-id3.3.3.3R3(config-router)#bgpconfederationidentifier100R3(config-router)#bgpconfederationpeers65001R3(config-router)#network3.3.3.0mask255.255.255.0R3(config-router)#neighbor4.4.4.4remote-as65002R3(config-router)#neighbor4.4.4.4update-sourceLoopback0R3(config-router)#neighbor4.4.4.4next-hop-selfR3(config-router)#neighbor13.13.13.1remote-asR3(config-router)#neighbor13.13.13.1next-hop-R3(config-router)#neighbor23.23.23.2remote-asR4(config)#routereigrpR4(config-router)#network4.4.4.0R4(config-router)#network34.34.34.00.0.0.255R4(config-router)#noauto-summaryR4(config)#routerbgp65002R4(config-router)#nosynchronizationR4(config-router)#noauto-summaryR4(config-router)#bgprouter-id4.4.4.4R4(config-router)#network4.4.4.0maskR4(config-router)#neighbor3.3.3.3remote-as65002R4(config-router)#neighbor3.3.3.3update-sourceLoopback0BGP用于將AS分割成多個(gè)子AS,是控制大型IBGP對(duì)等的另一條途徑而子AS被稱為成員自治系統(tǒng)。每個(gè)都有被分配一個(gè)ID,對(duì)外部來講,這個(gè)ID是代表整個(gè)的AS號(hào)碼。外部看不到內(nèi)部結(jié)構(gòu),看起來就是一個(gè)AS,成員自治系統(tǒng)信實(shí)驗(yàn)調(diào)R2#showipBGPtableversionis5,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? NextMetricLocPrfWeight*010000100*>032768*010000100*01000100“1.1.1.0/24路徑,而且都是來自AS100。由此看出BGP內(nèi)所有成員的信息對(duì)外都被隱藏。R3#showipBGPtableversionis6,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i-internal,rRIB-failure,SStaleOrigincodes:i-IGP,e-EGP,? Next MetricLocPrfWeight*>00(65001)*00(
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 佛山市小升初數(shù)學(xué)試卷
- 董村小學(xué)二年級(jí)數(shù)學(xué)試卷
- 2025至2030城市建設(shè)規(guī)劃行業(yè)市場(chǎng)發(fā)展前景及供給需求與投資機(jī)會(huì)報(bào)告
- 2025至2030軌道交通安防行業(yè)市場(chǎng)深度研究及發(fā)展前景投資可行性分析報(bào)告
- 六安市霍邱縣新店鎮(zhèn)選聘村干部考試真題2024
- 2024年杭州拱墅區(qū)專職社區(qū)工作者招聘筆試真題
- 2025至2030財(cái)務(wù)軟件產(chǎn)業(yè)深度調(diào)研及發(fā)展趨勢(shì)與投資戰(zhàn)略報(bào)告
- 東山小學(xué)期中數(shù)學(xué)試卷
- 工貿(mào)單招數(shù)學(xué)試卷
- 福州初三卷子數(shù)學(xué)試卷
- 各類給水管材水力計(jì)算表
- 濟(jì)南遙墻機(jī)場(chǎng)擴(kuò)建工程航站樓建設(shè)監(jiān)理大綱
- 七年級(jí)上冊(cè)數(shù)學(xué)知識(shí)點(diǎn)總結(jié)及精編例題1
- 往生薦亡功德文疏
- 員工上下班路線規(guī)劃圖
- 心內(nèi)科高危藥物安全管理與指引
- XFD-系列單槽說明書-印稿
- UCLA肩關(guān)節(jié)評(píng)分系統(tǒng)
- 分支型室速的導(dǎo)管消融術(shù)ppt課件
- (完整word版)《關(guān)于同意申辦出入境證件的函》
- 廣東外運(yùn)大宗散貨船舶代理業(yè)務(wù)發(fā)展研究
評(píng)論
0/150
提交評(píng)論