文件咨詢熱線_第1頁
文件咨詢熱線_第2頁
文件咨詢熱線_第3頁
文件咨詢熱線_第4頁
文件咨詢熱線_第5頁
已閱讀5頁,還剩222頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

目概 目概 BGP BGP鄰 BGP更新 BGP BGP BGP路由 BGP Path BGPRIB- BGP路由聚 BGP默認路 BGP路由過 BGPPeer BGP BGP后門路 BGP 1226概在當前所使用的計算機網(wǎng)絡中,一個網(wǎng)絡,通常使用一個IP網(wǎng)段來表示,要概在當前所使用的計算機網(wǎng)絡中,一個網(wǎng)絡,通常使用一個IP網(wǎng)段來表示,要段都知道其它IP網(wǎng)段的信息,就可以實現(xiàn)全網(wǎng)通信。將網(wǎng)絡與網(wǎng)絡連接起來的設備是路由器,只要網(wǎng)絡中每一臺路由器都知道所有IP網(wǎng)段的信息,就可以為全網(wǎng)提供數(shù)據(jù)轉發(fā),如果某一臺路由器不能得知所有的IP網(wǎng)段信息,也就表示這臺路2226AS,目的并不僅僅是將路由協(xié)議的更新注:BGPclasslessinterdomainroutingBGP-3226ASASASASASASAS,ISPASBGP鄰居PCFTPPCFTPBGPBGPOSPFOSPFIPVersion44226IPVersion6VirtualPrivateNetworksversionIPVersion6VirtualPrivateNetworksversion4ConnectionlessNetworkServicesLayer2VPN這些協(xié)議被稱addressfamily,配置時進入相應addressfamily模式Ipv4除外。所有命令addressfamily獨立配置,獨立生效,并且都擁有獨立的數(shù)據(jù)庫。正常的BGP配置模式被稱為NLRI模式,而addressfamily模式稱思科路由器BGPversion4,一臺路由器只能運行一個BGP進程,并且AS,addressfamily,而一臺BGP路由器運行在一個單一的AS內,在和其它BGP路由器建立鄰居時,如AS,internalBGPiBGP),如果屬于AS,externalBGPeBGP)。BGPeBGP秒沒有收到鄰居的Keepalive,便認為鄰居丟失,則斷開與鄰居的連接。5226BGP之間建立鄰居,需要經(jīng)BGP之間建立鄰居,需要經(jīng)歷如下幾個過程Idle—BGP進程被啟動或被重置,這個狀態(tài)是等待開始,比如等于指定一個BGPidleConnect—檢測到peer要嘗TCP連接Active—嘗試和對peerTCP接,如有故障,則回到idle狀notificationidleEstablishedpeerkeepalive,并開始交換數(shù)據(jù),收到BGP更新源會將數(shù)據(jù)包發(fā)往指定的地址來請求建立鄰居,與此同時,BGP發(fā)出的請求數(shù)據(jù)包除流量后從接口發(fā)出時,流量從哪個接口被發(fā)出,那么這些數(shù)據(jù)包的源IP地址就是IPBGP6226BGPBGP,BGPF0/0,R1IPR2BGP源地完全相同,所以最終能夠正BGP鄰loopbackloopback7226loopbackBGP都不影響鄰居的會話,BGPBGPBGP了路由環(huán)路,最后就會丟棄收到的路由。BGPeBGP8226AS20之后,AS-path變成“20,10AS30將路由發(fā)AS50最終AS-path因為BGP在將路由發(fā)給eBGP鄰居時,會將自己的AS號碼添加到AS-path中,所以可以以此來防止環(huán)路,而在將路由發(fā)iBGP時,是不會AS-pathASiBGPiBGPBGPAS9226R3R4R1路由后,都不可以轉發(fā)iBGPR2,在上圖環(huán)境中,最10226BGP路由表11226BGP的鄰居類型分BGP的鄰居類型分為兩種:eBGPiBGPBGP路由AD值也有區(qū)分,BGPBGPAD200,與并不會在一開始,就通過比較AD值來選擇最優(yōu)路徑。BGP12226在上圖的網(wǎng)絡在上圖的網(wǎng)絡中,R1R4eBGP連接,R3R5eBGP連接R1與iBGPR/24R3R313226eBGP)IGPBGPIOS12.2(8)TPathPathAttributes,即路徑屬性,只有在比較多條路由的屬性公認強(Well-Known公認自(Well-Known14226可選可傳遞(Optional可選不可傳遞可選可傳遞(Optional可選不可傳遞(Optional公認強制(Well-Known公認自選(Well-KnownBGP可選可傳遞(OptionalBGP可選不可傳遞(OptionalBGP152261.Origin(公認強制屬性1.Origin(公認強制屬性在初始狀態(tài)下,BGPBGPOrigin,OriginIGPBGPBGPIGPEGP,EGPIncomplete,即2.AS_Path(公認強制屬性16226AS_SEQUENCE(有序的AS號碼,即AS_SEQUENCE(有序的AS號碼,即AS號碼AS_Path中是按一定順序排列的AS_SET(無序的AS號碼AS號碼AS_Path的排列是沒有順序的,通3.Next_Hop(公認強制屬性己的地址,也就是和對方建立鄰居所使用的地址,而在將路由傳遞給iBGP鄰居4.Local_Pref(公認自選屬性Local_Pref稱為本地優(yōu)先級,其中的(Local)本地就是指ASAS內的意思,所以可以想象得出,Local_Pref屬性的傳遞范圍,只在同一個AS內有效,一條Local_PrefASAS1722618226在上圖中,AS10BGP在上圖中,AS10BGP路由R3可以同R1與R2往目的AS20R1R2在將iBGPR3時會Local_Pref屬性R3同時比iBGPR1iBGPR2時,才合適使Local_Pref屬性,因為下5.MULTI_EXIT_DISC(MED,可選不可傳遞屬性eBGPMED。MEDBGPLocal_Pref屬性只在同一個AS內部傳遞,而MED只能在AS之間傳遞,只有在將路由發(fā)給eBGP鄰居時,才會傳遞MED,在發(fā)給iBGP時,是不會傳遞MED的。當一條路由被設置MED值后傳遞給eBGP鄰居,在eBGP鄰居收到后,如果將該路由繼續(xù)傳遞給iBGP鄰居,那么這個值會被還原為0,也就是說同AS內,所有iBGPMED0AS19226eBGPMEDBGPbgp20226Weight屬性為Cisco私有屬性,只有Cisco的路由器才Weight屬性為Cisco私有屬性,只有Cisco的路由器才能認識和理解Weight。路由的Weight屬性只在路由器本地起作用,BGP將路由傳遞給鄰居時,并不會保留Weight。Weight值的范圍為0~65535,默認為0,如果是BGP本地路由,則Weight在BGP的路由表中,并非所有的路由都會被BGP使用,默認情況下,BGP到任何目的地,只選擇單一路徑。BGP表中,只有最優(yōu)路由才會BGP使用,也只有21226BGP最優(yōu)路徑選1.最高Weight2.最高LOCAL_PREF222263.本地發(fā)起3.本地發(fā)起4.最短是可以跳過這命令bgpbestpathas?pathignore后,就會忽略AS_PATH5.最低Origin類(如AS_PATH無法比出最優(yōu)路徑則選擇擁有最Origin類型的路由Origin表EGPEG6.最小MED(如Origin類型無法比出最優(yōu)路徑,則選擇擁有最MED路由,并且只有當多個下一跳鄰居在同一AS時才比較MED值。如果要在多個不同AS的下一跳中比MED,可BGP進程中輸入命令bgpalways-compare-med,注意須保證此命令在整7.eBGP優(yōu)于23226(MEDeBGPiBGP(MEDeBGPiBGP有此規(guī)則。8.最小IGPmetric下一跳的路到達下一跳的路由。9.負載均衡(如果開啟的話10.如果下一跳都eBGP,則選擇最早學習到的路由(即時間最長的路由24226比如路由是從同一個鄰居學習到的,同樣也會忽略比較路由學習到的時間長短。11.最低Router-ID下一由將被選為最優(yōu)路徑。12.最短clusterlist(如同[clusterlistBGPreflectorRR13.最小下一跳的鄰居地徑的鄰居地址是相同的,在這一步一定能夠選出最優(yōu)路徑。25226BGP基礎實說明:0000BGP基礎實說明:0000262261.IGP使全網(wǎng)Loopback0(1)配置各路由器的1.IGP使全網(wǎng)Loopback0(1)配置各路由器的r1(config)#routerospfr1(config-router)#router-idareaareaarear2(config)#routerospfr2(config-router)#router-idareaareaarear3(config)#routerospfr3(config-router)#router-id27226areaareaarear4(config)#routerospfr4(config-router)#router-idareaareaarear4(config)#routerospfr4(config-router)#router-idareaareaarea2查IGP(1)檢查R1上的OSPF鄰r1#showipNeighbor1282261說明:R1R2R3OSPF(2)檢查R4上的OSPF鄰r4#showipNeighbor1說明:R1R2R3OSPF(2)檢查R4上的OSPF鄰r4#showipNeighbor11說明:R4R2R3OSPF(3)在R1上查看全網(wǎng)的loopback0通信情r1#pingsourceloopbackTypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2Packetsentwithasourceaddressof29226Successrateis100percent(5/5),round-tripmin/avg/max=r1#pingSuccessrateis100percent(5/5),round-tripmin/avg/max=r1#pingsourceloopbackTypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2PacketsentwithasourceaddressofSuccessrateis100percent(5/5),round-tripmin/avg/max=r1#pingsourceloopbackTypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2PacketsentwithasourceaddressofSuccessrateis100percent(5/5),round-tripmin/avg/max=302263立BGP(1)在R1R2之間建立BGP鄰r1(config)#routerbgpr1(config-router)#bgprouter-idr1(config-router)#neighbor3立BGP(1)在R1R2之間建立BGP鄰r1(config)#routerbgpr1(config-router)#bgprouter-idr1(config-router)#neighborremote-as(2)在R1R2之間建立BGP鄰r2(config)#routerbgpr2(config-router)#bgprouter-idr2(config-router)#neighborremote-as(3)查看BGP鄰r1#showipbgpBGProuteridentifier,localASnumberBGPtableversionmainroutingtableversionVMsgRcvdTblVerInQUp/Down410000031226說明:R1R2BGP,而對方源地(4)修改R1BGP源地說明:R1R2BGP,而對方源地(4)修改R1BGP源地r1(config)#routerbgpr1(config-router)#neighborupdate-sourceloopback(5)查看R1BGP鄰r1#showipbgpBGProuteridentifier,localASnumberBGPtableversionmainroutingtableversionVMsgRcvdTblVerInQUp/Down4199 0032226(6)修改R2BGP源地r2(config)#routerbgpr2(config-router)#neighbor(6)修改R2BGP源地r2(config)#routerbgpr2(config-router)#neighborupdate-sourceloopback4立R2與R4的BGP(1)配置R2BGP參r2(config)#routerbgpr2(config-router)#neighborremote-asr2(config-router)#neighborupdate-sourceloopback(2)配置R4BGP參r4(config)#routerbgpr4(config-router)#bgprouter-idr4(config-router)#neighborremote-asr4(config-router)#neighborupdate-sourceloopback33226(3)查看BGP鄰r2#shipbgpBGProuteridentifier,localASnumberBGPtableversionmainroutingtableversion(3)查看BGP鄰r2#shipbgpBGProuteridentifier,localASnumberBGPtableversionmainroutingtableversionVUp/Down41100044000001(4)修改R2R4TTLr2(config)#routerbgpr2(config-router)#neighborebgp-r4(config)#routerbgpr4(config-router)#neighborebgp-34226(5)查看BGP鄰r2#shipbgpBGProuteridentifier,localASnumberBGP(5)查看BGP鄰r2#shipbgpBGProuteridentifier,localASnumberBGPtableversionmainroutingtableversionVUp/Down41100044441000說明:由于鄰居參數(shù)配置,所以鄰居已經(jīng)正常建立5布BGP(1)查看BGP路由r1#ship35226ipip(2)在R1上ipip(2)在R1上導入BGP路由r1(config)#routerbgpr1(config-router)#networkmaskBGP(3)查看R1BGP路由1#shipBGPtableversionis2,localrouterIDis36226Statusssuppressed,ddamped,hhistory,*valid,>best,irRIB-failure,SOriginiStatusssuppressed,ddamped,hhistory,*valid,>best,irRIB-failure,SOrigini-IGP,e-?-NextMetricLocPrfWeight*>032768說明:R1已經(jīng)通過命令將/24BGPoriginIGPIGPBGP(4)在R2上導入BGP路由r2(config)#route-maplooppermitr2(config-route-map)#matchinterfaceloopbackr2(config)#routerbgpr2(config-router)#redistributeconnectedroute-map(5)查看R2BGP路由37226r2#shipBGPtableversionis2,localrouterIDisStatusssuppressed,ddamped,hhistory,*valid,r2#shipBGPtableversionis2,localrouterIDisStatusssuppressed,ddamped,hhistory,*valid,>best,irRIB-failure,SOrigini-IGP,e-?-Next*00i*>0?默認NextHop,并且weight值為32768,并且因為是使用重分布的方originincomplete/24R1學iiBGP鄰居學習到(6)在R4上導入BGP路由r4(config)#routerbgpr4(config-router)#networkmask說明:network/24BGP38226(7)查看R4BGP路由r4#shipBGPtableversionis3,localrouterIDisStatuscodes:suppressed,(7)查看R4BGP路由r4#shipBGPtableversionis3,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>best,irRIB-failure,SOrigincodes:-IGP,e-?-Next*>001*>0iNextHopweight32768,originIGP/24eBGPR面的?originincomplete6證BGP(1)查看R1BGP路由r1#shipBGPtableversionis2,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i39226rRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i*00?*rRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i*00?*004現(xiàn)>符號,表示該路由為最優(yōu)路徑,被BGP選中并使用,而/24和(2)在R1上關閉iBGPIGP之間的同r1(config)#routerbgpr1(config-router)#no(3)再次查看R1的BGP路由r1#shipBGPtableversionis4,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i40226rRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?004說明:由于所有路由的下一跳都可達,并iBGP(4)查看rRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?004說明:由于所有路由的下一跳都可達,并iBGP(4)查看R4BGP路由r4#shipBGPtableversionis3,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>best,irRIB-failure,SOrigincodes:-IGP,e-?-Next*>001*>0i41226(5)查看R2BGP路由r2#shipBGPtableversionis3,localrouterID(5)查看R2BGP路由r2#shipBGPtableversionis3,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*>i-rRIB-failure,SOrigincodes:-IGP,e-?-Next*00i*>0?*>004(6)在R2上關閉iBGPIGP之間的同r2(config)#routerbgp42226r2(config-router)#no(7)再次查看R2的BGP路由r2#shipBGPtableversionis4,localrouterIDisStatusssuppressed,ddamped,r2(config-router)#no(7)再次查看R2的BGP路由r2#shipBGPtableversionis4,localrouterIDisStatusssuppressed,ddamped,hhistory,*valid,>i-rRIB-failure,SOrigini-IGP,e-?-Next00i*>0?*>004說明:由于所有路由的下一跳都可達,并iBGP(8)查看R4BGP路由r4#shipBGPtableversionis4,localrouterIDisStatuscodes:ssuppressed,ddamped,hhistory,*valid,>best,i43226rRIB-failure,SOrigincodes:-IGP,e-?-Next01i001?0irRIB-failure,SOrigincodes:-IGP,e-?-Next01i001?0i1.R4創(chuàng)建網(wǎng)段并發(fā)布進(1)R4網(wǎng)段并發(fā)布進r4(config)#intloopbackr4(config-if)#ipaddressr4(config-if)#ipospfnetworkpoint-to-r4(config)#routerospfr4(config-router)#network442260(2)R4將/24導入BGP路由r4(config)#routerbgpr4(config-router)#networkmask(3)查看R4BGP路由r4#shipBGPtableversionis(2)R4將/24導入BGP路由r4(config)#routerbgpr4(config-router)#networkmask(3)查看R4BGP路由r4#shipBGPtableversionis7,localrouterIDisStatusssuppressed,ddamped,hhistory,*>i-rRIB-failure,SOrigini-IGP,e-?-Next010010i0i說明452262看RIB(1)查看R2BGP路由r2#shipBGPtableversionis7,localrouterIDisStatusssuppressed,ddamped,hhistory,*2看RIB(1)查看R2BGP路由r2#shipBGPtableversionis7,localrouterIDisStatusssuppressed,ddamped,hhistory,*valid,>i-rRIB-failure,SOrigini-IGP,e-?-Next00i0?004004說明:R2(2)查看R1BGP路由r1#ship46226BGPtableversionis6,localrouterIDisssuppressed,ddamped,hhistory,*valid,>i-StatusrRIB-failure,SOrigincodes:-IGP,e-?-NextBGPtableversionis6,localrouterIDisssuppressed,ddamped,hhistory,*valid,>i-StatusrRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?004004說明:R2RIBfailurer(3)查看R1RIBfailurer1#shipNextHigher472261R1,R2,R3,R4全網(wǎng)建立BGP,并且互(1)將R3加入1R1,R2,R3,R4全網(wǎng)建立BGP,并且互(1)將R3加入BGPr1(config)#routerbgpr1(config-router)#neighborremote-1r1(config-router)#neighborupdate-0r3(config)#routerbgpr3(config-router)#bgprouter-idremote-as0remote-as048226r4(config)#routerbgpremote-as0(2)查看R3BGP鄰r3#shipbgBGProuteridentifier,r4(config)#routerbgpremote-as0(2)查看R3BGP鄰r3#shipbgBGProuteridentifier,ASnumberBGPtableversionis4,maintable43networkentriesusing351bytes3pathentriesusing156bytesof3/2BGPattributeentriesusing372bytesof1AS-PATHusing24bytesof0route-mapentriesusingbytesof0filter-listcacheentries0bytesofBGPusing903totalbytesofBGPactivity3/0prefixes,3/0scaninterval6049226VUp/Down41774001447540022變AS1(1)查看R1BGP路由r1#shipBGPtableVUp/Down41774001447540022變AS1(1)查看R1BGP路由r1#shipBGPtableversionis6,localrouterisStatuscodes:suppressed,ddamped,history,valid,>best,irRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?50226*004i004ir004i004i*004i004ir004i004i(2)改變R2與R3R1的下一跳為r2(config)#routerbgpr2(config-router)#neighbornext-hop-r3(config)#routerbgpr3(config-router)#neighbornext-hop-(3)再次查看R1的BGP路由r1#shipBGPtableversionis8,localrouterIDissuppressed,ddamped,hhistory,valid,>best,iStatuscodes:rRIB-failure,SOrigincodes:i-IGP,e-EGP,?-51226Next*>0i00?*004i004ir004i004iNext*>0i00?*004i004ir004i004i52226.如果下一跳都為.如果下一跳都為測試13條最小下一跳的鄰居地(1)修改R3Router-IDR2相r3(config)#routerbgpr3(config-router)#bgprouter-id53226(2)查看R1到達/24的選r1#shipBGPtableversionis8,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>i-rRIB-failure,S(2)查看R1到達/24的選r1#shipBGPtableversionis8,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>i-rRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?*004i004ir004i004i測試12cluster54226測試11Router-ID一(1)修改R3的測試11Router-ID一(1)修改R3的Router-r3(config)#routerbgpr3(config-router)#bgprouter-id說明:R3的Router-ID(2)查看R1到達/24的選r1#shipBGPtableversionis10,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>best,irRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?55226004i*004i004ir004i說明:因為R2Router-ID,而R3的Router-ID,測試第10004i*004i004ir004i說明:因為R2Router-ID,而R3的Router-ID,測試第10如果下一跳都為eBGP,則選擇最早學習到的路由(即時(1)查看R4到達/24的選r4#shipBGPtableversionis7,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>best,irRIB-failure,SOrigincodes:-IGP,e-?-Next*010156226001?0i0i(2)查看R2與R3的鄰居時r4#shipbgBGProuteridentifier,001?0i0i(2)查看R2與R3的鄰居時r4#shipbgBGProuteridentifier,AS4BGPtableversionis7,maintableversion4networkentriesusing404bytes5pathentriesusing240bytesof3pathattributeentriesusing180bytesof1AS-PATHentriesusing24bytesof0route-mapcacheentriesusingbytesof0filter-listcacheentries0bytesofBGPusing848totalbytesofBGPactivity5/1prefixes,8/3scaninterval60VASMsgRcvdTblVerInQUp/Down57226417002417001說明:因為(3)清除R2的鄰居417002417001說明:因為(3)清除R2的鄰居,以刷新鄰居時r4(config)#routerbgpr4(config-router)#neighbor*Mar101:16:09.823:%BGP-5-ADJCHANGE:neighborr4(config-router)#noneighbor*Mar101:16:37.452:%BGP-5-ADJCHANGE:neighbor(4)再次查看鄰居的建立時r4#shipbgBGProuteridentifier,localASnumber58226BGPtableversionis10,mainroutingtableversion4networkentriesusing404bytesof5pathentriesusing240bytesof3pathattributeentriesusing180bytesBGPtableversionis10,mainroutingtableversion4networkentriesusing404bytesof5pathentriesusing240bytesof3pathattributeentriesusing180bytesof1AS-PATHentriesusing24bytesof0route-mapcacheentriesusing0bytesof0filter-listcacheentriesusing0bytesofBGPusing848totalbytesofBGPactivity5/1prefixes,paths,scanintervalVUp/Down4100241001(5)再次查看R4到達的選r4#shipBGPtableversionis10,localrouteris59226Statusssuppressed,ddamped,hhistory,*valid,>i-rRIB-failure,SOrigini-IGP,e-?-Next*01i01i00Statusssuppressed,ddamped,hhistory,*valid,>i-rRIB-failure,SOrigini-IGP,e-?-Next*01i01i001?0i0i測試9BGP均8(1)查看R1到達/24的選r1#shiproute/24issubnetted,1B[200/0]via,60226/24issubnetted,1B[200/0]via,說明:R144.4.0/24/24issubnetted,1B[200/0]via,說明:R144.4.0/24R3,默認沒有負載(2)開啟BGP負載功r1(config)#routerbgpr1(config-router)#maximum-pathsibgp(3)再次查看R1到達44.4.0/24選r1#shiprouteissubnetted,1B[200/0]via,issubnetted,1B[200/0]via,[200/0]via,(4)查看R4到達/24的選61226r4#shiprouteissubnetted,1B[20/0]via,issubnetted,1B[20/0]r4#shiprouteissubnetted,1B[20/0]via,issubnetted,1B[20/0]via,(5)開啟R4到達/24的負r4(config)#routerbgpr4(config-router)#maximum-paths(6)再次查看R4到達/24的選r4#shiprouteissubnetted,1B[20/0]via,issubnetted,1B[20/0]via,[20/0]via,62226測試8IGPmetric到達下一跳的路(1)查看R1到達/24的選r1#shipBGPtableversionis14,localrouterIDisStatus測試8IGPmetric到達下一跳的路(1)查看R1到達/24的選r1#shipBGPtableversionis14,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*>i-rRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?*004i004ir004i004i63226(2)查看到達兩個下一跳R2R3IGPmetricr1#shCodes:-connected,S-static,R-RIP,(2)查看到達兩個下一跳R2R3IGPmetricr1#shCodes:-connected,S-static,R-RIP,M-mobile,B-D-EIGRP,EX-EIGRPO-OSPF,IA-OSPFinterN1-OSPFNSSAexternaltypeN2-OSPFNSSAexternaltypeE1-OSPFexternaltype1,E2OSPFexternaltype*candidatedefault,U-per-userstaticroute,o-PperiodicdownloadedstaticGatewaylastresortisnot/24issubnetted,1O[110/2]via,subnetted,1Cdirectlyconnected,subnetted,1O[110/2]via,00:28:17,/24issubnetted,1O[110/3]via,00:28:17,64226[110/3]via,00:28:17,issubnetted,1O[110/2]via,issubnetted,1O[110/3]via,[110/3]via,issubnetted,1[110/3]via,00:28:17,issubnetted,1O[110/2]via,issubnetted,1O[110/3]via,[110/3]via,issubnetted,1B[200/0]via,issubnetted,1O[110/2]via,00:28:21,subnetted,1Cdirectlyconnected,subnetted,1Cdirectlyconnected,subnetted,1Cdirectlyconnected,subnetted,1B[200/0]via,[200/0]via,65226(3)改大到達下一跳R3IGPmetric值,使最優(yōu)路徑走r1(config)#intr1(config-if)#ip(3)改大到達下一跳R3IGPmetric值,使最優(yōu)路徑走r1(config)#intr1(config-if)#ipospfcost(4)再次查看到達兩個下一跳R2R3IGPmetricr1#shCodes:-connected,S-static,R-RIP,M-mobile,B-D-EIGRP,EX-EIGRPO-OSPF,IA-OSPFinterN1-OSPFNSSAexternaltypeN2-OSPFNSSAexternaltypeE1-OSPFexternaltype1,E2OSPFexternaltype*candidatedefault,U-per-userstaticroute,o-PperiodicdownloadedstaticGatewaylastresortisnot/24issubnetted,1O[110/3]via,00:01:10,[110/3]via,00:01:10,/32issubnetted,166226Cisdirectlyconnected,issubnetted,1O[110/2]via,00:01:10,/24issubnetted,1O[110/3]via,00:01:10,issubnetted,1O[110/3]viaCisdirectlyconnected,issubnetted,1O[110/2]via,00:01:10,/24issubnetted,1O[110/3]via,00:01:10,issubnetted,1O[110/3]via,00:01:11,issubnetted,1O[110/3]via,00:01:11,issubnetted,1B[200/0]via,issubnetted,1O[110/2]via,00:01:11,subnetted,1Cdirectlyconnected,subnetted,1Cdirectlyconnected,subnetted,1Cdirectlyconnected,subnetted,1B[200/0]via,67226說明:R2的metric2R3metric3R2(5)再次查看R1到達/24的選r1#shipBGPtableversionis16,localrouterIDisssuppressed,ddamped,h說明:R2的metric2R3metric3R2(5)再次查看R1到達/24的選r1#shipBGPtableversionis16,localrouterIDisssuppressed,ddamped,hhistory,*valid,>i-StatusrRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?004i*004i004ir004i說明:R2IGPmetricR3R268226測試第7eBGP優(yōu)于測試第6最小MED測試第7eBGP優(yōu)于測試第6最小MED/24的選路。(1)查看R1到達/24的選r1#shipBGPtableversionis16,localrouterIDisStatusssuppressed,ddamped,hhistory,*valid,>i-rRIB-failure,SOrigini-IGP,e-?-Next*>0i00?00469226*004i004ir004i說明:R2R3的(2)加大R2*004i004ir004i說明:R2R3的(2)加大R2MED值,使其走r1(config)#access-list44permitr1(config)#route-mapmedpermitr1(config-route-map)#matchipaddressr1(config-route-map)#setmetricr1(config)#route-mapmedpermitr1(config)#routerbgpr1(config-router)#neighbor自動刷新r1(config)#routerbgp70226r1(config-router)#neighborsoft-reconfiguration(3)再次查看R1到達/24的選r1#shipBGPtableversionis17,localrouterIDisssuppressed,ddamped,hhistory,*valid,r1(config-router)#neighborsoft-reconfiguration(3)再次查看R1到達/24的選r1#shipBGPtableversionis17,localrouterIDisssuppressed,ddamped,hhistory,*valid,>i-StatusrRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?*04i004i004ir004i說明:R3MEDR2,所注:R4上修MED影響選路的方法不再舉例71226測試5Origin(1)查看R1到達/24的選r1#shipBGPtableversionis17,localrouterIDisStatuscodes:suppressed,d測試5Origin(1)查看R1到達/24的選r1#shipBGPtableversionis17,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>i-rRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?*04i004i004ir004i72226(2)將R3origin性改為incomplete,使r1(config)#route-maporipermitr1(config-route-map)#matchipaddressr1(config-route-map)#setorigin(2)將R3origin性改為incomplete,使r1(config)#route-maporipermitr1(config-route-map)#matchipaddressr1(config-route-map)#setoriginr1(config)#route-maporipermitr1(config)#routerbgpr1(config-router)#neighborroute-mapr1(config-router)#neighborsoft-reconfiguration(3)再次查看R1到達/24的選r1#shipBGPtableversionis18,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>irRIB-failure,SOrigincodes:-IGP,e-?-NextMetricLocPrfWeight*>7322603276800?04i*004?004ir004i00?04i*004?004ir004i測試第4條最(1)查看R4到達/24的選r4#shipBGPtableversionis14,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>best,irRIB-failure,SOrigincodes:-IGP,e-EGP,?-74226Next*01i01i001?0i0i說明:R2R3AS_Path(2)加長Next*01i01i001?0i0i說明:R2R3AS_Path(2)加長R3路徑上的AS_Path,使r4(config)#access-list3permitr4(config)#route-mapaspermitr4(config-route-map)#matchipaddressr4(config-route-map)#setas-path3r4(config)#route-mapaspermitr4(config)#routerbgpr4(config-router)#neighborroute-map75226r4(config-router)#neighborsoft-reconfiguration(3)再次查看R4到達/24的選r4#shipBGPtableversionis15,localrouterIDisssuppressed,ddamped,hhistory,*r4(config-router)#neighborsoft-reconfiguration(3)再次查看R4到達/24的選r4#shipBGPtableversionis15,localrouterIDisssuppressed,ddamped,hhistory,*valid,>i-StatusrRIB-failure,SOrigincodes:-IGP,e-?-Next01i*031i001?0i0i測試3地發(fā)起路76226測試2LOCAL_PREFR4/24(1)查看R4到達/24的選r4#shipBGPtableversionis測試2LOCAL_PREFR4/24(1)查看R4到達/24的選r4#shipBGPtableversionis15,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>best,-rRIB-failure,SOrigincodes:-IGP,e-?-Next01i*031001?0i0i77226(2)改R3LOCAL_PREF值比R2大,讓其走(2)改R3LOCAL_PREF值比R2大,讓其走r4(config)#access-list11permitr4(config)#route-mapr3permitr4(config-route-map)#matchipaddressr4(config-route-map)#setlocal-3r4(config)#route-mapr3permitr4(config)#route-mapr2permitr4(config-route-map)#matchipaddressr4(config-route-map)#setlocal-2r4(config)#route-mapr2permitr4(config)#routerbgpr4(config-router)#neighborroute-r3r4(config-router)#neighborroute-r278226r4(config-router)#neighborsoft-reconfiguration(3)再次查看R4到達/24的選r4#shipBGPtableversionis5,localrouterIDisssuppressed,ddamped,hhistory,*valid,r4(config-router)#neighborsoft-reconfiguration(3)再次查看R4到達/24的選r4#shipBGPtableversionis5,localrouterIDisssuppressed,ddamped,hhistory,*valid,>i-StatusrRIB-failure,SOrigincodes:-IGP,e-?-Next*201i301i001?0i0i注:R1上修LOCAL_PREF影響選路的方法不再舉例79226測試第1最高Weight(1)查看R1到達/24的選r1#shipBGPtableversionis23,localrouterIDisStatuscodes:suppressed,ddamped,h測試第1最高Weight(1)查看R1到達/24的選r1#shipBGPtableversionis23,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>i-rRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?*004?04ir004i004i80226(2)改大R3的weight值,使其走r1(config)#routerbgpr1(config-router)#neighborweight(3)再次查看R1到達/24的選r1#shipBGPtableversionis6,localrouterIDis(2)改大R3的weight值,使其走r1(config)#routerbgpr1(config-router)#neighborweight(3)再次查看R1到達/24的選r1#shipBGPtableversionis6,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,>i-rRIB-failure,SOrigincodes:-IGP,e-?-Next*>0i00?*04i034?r004i034i81226BGPBGP路由聚路由聚合。在BGP中做路由匯總,需要手工創(chuàng)建,只要有一條路由包含在匯總當創(chuàng)建了BGP匯總路由后,并不表示一定能夠縮小路由表大小,因為在創(chuàng)建匯AS_PathAS_PathAS15,AS25,AS35,AS45,AS-SET,很有可能就是{35,15,45,25}。由此可見,擁有AS-SET的匯總路由沒有丟失路徑,所以這樣的匯總路由就不需要攜帶atomic-aggregate屬性,也不會攜帶82226只被計算為1AS配置路由聚83226說明:00000084說明:000000842261.IGP保證全網(wǎng)Loopback0(1)配置1.IGP保證全網(wǎng)Loopback0(1)配置說明:此步略,請參見之前配置(2)測試全網(wǎng)Loopback0連通r1#pingsource0TypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2PacketsentwithasourceaddressofSuccessrateis100percent(5/5),round-tripmin/avg/max=16/50/88r1#pingsourceloopbackTypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2PacketsentwithasourceaddressofSuccessrateis100percent(5/5),round-tripmin/avg/max=16/43/76r1#pingsourceloopback85226TypeescapesequencetoSending5,100-byteICMPEchostoTypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2PacketsentwithasourceaddressofSuccessrateis100percent(5/5),round-tripmin/avg/max=r1#pingsourceloopbackTypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2PacketsentwithasourceaddressofSuccessrateis100percent(5/5),round-tripmin/avg/max=r1#pingsourceloopbackTypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2Packetsentwithasourceaddressof86226Successrateis100percent(5/5),round-min/avg/max=2.配置全網(wǎng)(1)配置R1r1(config)#routerbgpr1(config-router)#bgpSuccessrateis100percent(5/5),round-min/avg/max=2.配置全網(wǎng)(1)配置R1r1(config)#routerbgpr1(config-router)#bgprouter-id1update-source0remote-asupdate-source0r1(config-router)#networkmask(2)配置R2r2(config)#routerbgpr2(config-router)#bgprouter-idremote-asupdate-source0remote-asupdate-source087226r2(config-router)#neighborebgp-r2(config-router)#networkmask(3)配置R3r3(config)#routerbgpr3(config-router)#bgprouter-idremote-asupdate-source0remote-asupdate-source0r2(config-router)#neighborebgp-r2(config-router)#networkmask(3)配置R3r3(config)#routerbgpr3(config-router)#bgprouter-idremote-asupdate-source0remote-asupdate-source0r3(config-router)#networkmask(4)配置R4r4(config)#routerbgpr4(config-router)#bgprouter-idremote-asupdate-source0remote-asupdate-source0remote-as88226update-source0remote-asupdate-source0r4(config-router)#networkmask(5)配置R5r5(config)#routerbgpr5(config-router)#bgprouter-idremote-asupdate-source0remote-asupdate-source0r4(config-router)#networkmask(5)配置R5r5(config)#routerbgpr5(config-router)#bgprouter-idremote-asupdate-source0r5(config-router)#networkmask(6)配置R6r6(config)#routerbgpr6(config-router)#bgprouter-idremote-asupdate-source0r6(config-router)#networkmask892263建BGP(1)在R1R6上添加BGP3建BGP(1)在R1R6上添加BGP明細路r1(config)#intloopbackr1(config-if)#ipaddressr1(config)#routerbgpr1(config-router)#networkmaskr6(config)#intloopbackr6(config-if)#ipaddressr6(config-if)#ipaddressr6(config)#routerbgpr6(config-router)#networkmaskr6(config-router)#networkmask(2)在R5上查看BGP路r5#shipBGPtableversionis10,localrouterIDis90226Statusssuppressed,ddamped,hhistory,*valid,>best,-rRIB-failure,SOrigini-IGP,e-?-Next041i041i041i004i0i046iStatusssuppressed,ddamped,hhistory,*valid,>best,-rRIB-failure,SOrigini-IGP,e-?-Next041i041i041i004i0i046i041i046i046i1(3)在R4上創(chuàng)建BGP路由匯r4(config)#routerbgp91226r4(config-router)#aggregate-address說明:4看BGP(1)在R5上查看BGP匯總路r5#shipBGPtableversionis11,localrouterIDisStatusssuppressed,ddamped,hhistory,*valid,best,-rRIB-failure,SOrigini-IGP,e-?-r4(config-router)#aggregate-address說明:4看BGP(1)在R5上查看BGP匯總路r5#shipBGPtableversionis11,localrouterIDisStatusssuppressed,ddamped,hhistory,*valid,best,-rRIB-failure,SOrigini-IGP,e-?-Next041i041i041i004i0i046i004i041i92226046i*>046(2)查*>046(2)查看atomic-r5#shipbgpBGProutingtableentryfor/22,versionPaths:(1available,best#1,tableDefault-IP-Routing-Notadvertisedany4,(aggregated465)fromOriginIGP,metric0,localpref100,valid,atomic-aggregate,5整BGP匯總路由路徑信(1)調整AS-r4(config)#routerbgpr4(config-router)#aggregate-addressas-93226(2)再次查看R5的BGP匯總路r5#shipBGPtableversionis12,localrouterIDisStatusssuppressed,ddamped,hhistory,*valid,>best,-rRIB-failure,SOrigini-IGP,e-?-Next(2)再次查看R5的BGP匯總路r5#shipBGPtableversionis12,localrouterIDisStatusssuppressed,ddamped,hhistory,*valid,>best,-rRIB-failure,SOrigini-IGP,e-?-Next041i041i041i004i0i046i*>0041i046i046i94226(3)查看atomic-r5#shipbgp(3)查看atomic-r5#shipbgpBGProutingtableentryfor/22,versionPaths:(1available,best#1,tableDefault-IP-Routing-Flag:Notadvertisedtoany4{1,6},(aggregatedby4(metric65)fromOriginIGP,metric0,localpref100,valid,external,6整BGP匯總路由抑制(1)在R4上抑制不需要通告的明細r4(config)#access-list1permitr4(config)#route-mapsuppermitr4(config-route-map)#matchipaddress95226r4(config)#routerbgpr4(config-router)#aggregate-addressas-suppress-map(2)在R5上查看BGP路r5#shipBGPtableversionis12,localrouterIDisssuppressed,ddamped,r4(config)#routerbgpr4(config-router)#aggregate-addressas-suppress-map(2)在R5上查看BGP路r5#shipBGPtableversionis12,localrouterIDisssuppressed,ddamped,hhistory,*valid,>best,-StatusrRIB-failure,SOrigincodes:-IGP,e-?-Next041i041i041i004i0i046i*>096226*>046*>046(3)在R4上抑制全部明細路r4(config)#routerbgpr4(config-router)#aggregate-address(4)在R5上查看BGP路r5#ship*>046*>046(3)在R4上抑制全部明細路r4(config)#routerbgpr4(config-router)#aggregate-address(4)在R5上查看BGP路r5#shipBGPtableversionis15,localrouterIDisStatuscodes:suppressed,ddamped,hhistory,*valid,best,-rRIB-failure,SOrigincodes:-IGP,e-?-Next041i041i041i004i97226*>032768*>046*>0(5)在R4上查看抑制r4#shipBGPtableversionis15,localrouterIDisStatusssuppressed,ddamped,hhistory,*>*>032768*>046*>0(5)在R4上查看抑制r4#shipBGPtableversionis15,localrouterIDisStatusssuppressed,ddamped,hhistory,*>i-rRIB-failure,SOrigini-IGP,e-?-Next01i*01i001i001i0i005i98226006iis01i01i006i006i(6)使用不抑r4(config)#access-list3permitis01i01i006i006i(6)使用不抑r4(config)#access-list3permitr4(config)#route-mappermitipaddressr4(config)#routerbgpunsuppress-map(7)在R5上查看BGP路r5#ship99226BGPtableversionis16,localrouterIDisssuppressed,ddamped,hhistory,*valid,>best,-StatusrRIB-failure,SOrigincodes:-IGP,e-?-Next04BGPtab

溫馨提示

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

評論

0/150

提交評論