思科-networkgateway區(qū)別在cisco16448中詳細(xì)地講解了這三條命令使用條件和_第1頁
思科-networkgateway區(qū)別在cisco16448中詳細(xì)地講解了這三條命令使用條件和_第2頁
思科-networkgateway區(qū)別在cisco16448中詳細(xì)地講解了這三條命令使用條件和_第3頁
免費(fèi)預(yù)覽已結(jié)束,剩余7頁可下載查看

下載本文檔

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

文檔簡介

ipdefault-network、iproute、ipdefault-gatewaycisco16448ipdefault-gatewayiproutingipdefault-networkiprouteipdefault-networkiproute被路由選擇協(xié)議出去。ipdefault-network產(chǎn)生的默認(rèn)路由是可以被EIGRP和RIP的但不被OSPFRIPipdefault-network,debugipripiproute也可以被EIRGP,但是這條靜態(tài)路由必須重分發(fā)到EIGRP協(xié)議中;在12.0T以后的IOS版本中,RIP將不默認(rèn)路由,除非RIPRIP同樣,在OSPF中也不能該命令產(chǎn)生的默認(rèn)路由,(default-informationoriginate)ipdefault-network同時(shí)使用ipdefault-networkiproute方設(shè)定默認(rèn)路由時(shí),如果ipdefault-network設(shè)定的網(wǎng)絡(luò)是直連(靜態(tài)、且已知)的,那么它就成為默認(rèn)路由;如果ipdefault-network指定的網(wǎng)絡(luò)是由交換路由信iproute最后,如果使用多條iproute令,則流量會(huì)自動(dòng)在多條鏈負(fù)載均衡。ipdefault-gateway,ipdefault-networkiproute默認(rèn)路由的區(qū)別中遇到了也不犯錯(cuò)了。指定默認(rèn)路由(lastresortgateway)31、ipdefault-iproutingipdefault-gateway2、ipdefault-networkiproute兩者都用于iprouting有效的路由器上,區(qū)別主要在于路由協(xié)議是否這條路由信息。比如:IGRP無法識(shí)別,因此默認(rèn)路由時(shí)必須用ipipdefault-networkadministrativedistance同時(shí)使用ipdefault-networkiproute雙方設(shè)定默認(rèn)路由iprouteiprouteiproutingmycisco(config)#noiproutingmycisco(config)#ipdefault-gatewayType sequencetoSending5,100-byteICMPEchoesto5,timeoutis2Successrateis100percent(5/5),round-tripmin/avg/max=60/60/60msmycisco#showiprouteDefaultgatewayisHostGatewayLastUseTotalUsesInterfaceICMPredirectcacheisemptyiprouteiprouteType sequencetoSending5,100-byteICMPEchoesto5,timeoutis2Successrateis100percent(5/5),round-tripmin/avg/max=56/56/60msmycisco#showiprouteCodes:C–connected,S–static,I–IGRP,R–RIP,M–mobile,–D–EIGRP,EX–EIGRPexternal,O–OSPF,IA–OSPFinterareaE1–OSPFexternaltype1,E2–OSPFexternaltype2,E–EGPi–IS-IS,L1–IS-ISlevel-1,L2–IS-ISlevel-2,*–candidatedefaultU–per-userstaticrouteGatewayoflastresortistonetworkC/8isdirectlyconnected,Loopback0C/24isdirectlyconnected,Ethernet0S*/0[1/0]viaipdefault-networkmycisco(config)#iproutemycisco#showipCodes:C–connected,S–static,I–IGRP,R–RIP,M–mobile,–D–EIGRP,EX–EIGRPexternal,O–OSPF,IA–OSPFinterareaE1–OSPFexternaltype1,E2–OSPFexternaltype2,E–EGPi–IS-IS,L1–IS-ISlevel-1,L2–IS-ISlevel-2,*–candidatedefaultU–per-userstaticrouteGatewayoflastresortisnotC/8isdirectlyconnected,Loopback0S/8[1/0]viaC/24isdirectlyconnected,接著執(zhí)行mycisco(config)#ipdefault-networkmycisco#showipCodes:C–connected,S–static,I–IGRP,R–RIP,M–mobile,–D–EIGRP,EX–EIGRPexternal,O–OSPF,IA–OSPFinterareaE1–OSPFexternaltype1,E2–OSPFexternaltype2,E–EGPi–IS-IS,L1–IS-ISlevel-1,L2–IS-ISlevel-2,*–candidatedefaultU–per-userstaticrouteGatewayoflastresortistonetworkC/8isdirectlyconnected,Loopback0S*/8[1/0]viaC/24isdirectlyconnected,ipdefault-ipdefault-gatewaycommanddiffersfromtheothertwocommandsinthatitshouldonlybeusedwheniproutingisdisabledontheCiscorouter.Forinstance,iftherouterisahostintheIPworld,youcanusethiscommandtodefineadefaultgatewayforit.YoumightalsousethiscommandwhenyourlowendCiscorouterisinbootmodeinordertoTFTPaCiscoIOS®Softwareimagetotherouter.Inbootmode,therouterdoesnothaveiproutingenabled.ipdefault-Unliketheipdefault-gatewaycommand,youcanuseipdefault-networkwheniproutingisenabledontheCiscorouter.Whenyouconfigureipdefault-networktherouterconsidersroutestothatnetworkforinstallationasthegatewayoflastresortontherouter.Foreverynetworkconfiguredwithipdefault-network,ifarouterhasaroutetothatnetwork,thatrouteisflaggedasacandidatedefaultroute.LookatthefollowingroutingtabletakenfromaCiscorouter:2513#showipCodes:C-connected,S-static,I-IGRP,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaE1-OSPFexternaltype1,E2-OSPFexternaltype2,E-EGPi-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,*-candidatedefaultGatewayoflastresortisnotsetissubnetted,1subnets isdirectlyconnected,Ethernet0S[1/0]viaissubnetted,1subnets isdirectlyconnected,Notethestaticroutetoviaandthatthegatewayoflastresortisnotset.Ifyouconfigureipdefault-network,theroutingtablechangestothefollowing:2513#showipCodes:C-connected,S-static,I-IGRP,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaE1-OSPFexternaltype1,E2-OSPFexternaltype2,E-EGPi-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,*-candidatedefaultGatewayoflastresortistonetworkissubnetted,1subnets isdirectlyconnected,Ethernet0 [1/0]viaS*[1/0]viaissubnetted,1subnets isdirectlyconnected,TokenRing02513#showipprotocolsYoucanseethegatewayoflastresorthasnowbeensetas.Thisresultisindependentofanyroutingprotocol,asshownbytheshowipprotocolscommandatthebottomoftheoutput.YoucanaddanothercandidatedefaultroutesimplybyconfiguringanotherinstanceofipEnterconfigurationcommands,oneperline.EndwithCNTL/Z.2513(config)#ipdefault-network2513#showipCodes:C-connected,S-static,I-IGRP,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaE1-OSPFexternaltype1,E2-OSPFexternaltype2,E-EGPi-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,*-candidatedefaultGatewayoflastresortistonetworkissubnetted,1subnets isdirectlyconnected,Ethernet0 [1/0]via [1/0]viaisvariablysubnetted,2subnets,2 [1/0]via [1/0]viaissubnetted,1subnets isdirectlyconnected,TokenRing0Noticethatafterenteringtheabovecommand,thenetworkwasnotflaggedasadefaultnetwork.Thefollowingsectionexplainswhy.FlaggingaDefaultNote:Theipdefault-networkcommandisclassful,whieansiftherouterhasaroutetothesubnetindicatedbythiscommand,itinstallstheroutetothemajornet.Atthispointneithernetworkhasbeenflaggedasthedefaultnetwork.Theipdefault-networkcommandmustbeissuedagain,usingthemajornet,inordertoflagthecandidatedefaultroute.Enterconfigurationcommands,oneperline.EndwithCNTL/Z.2513(config)#ipdefault-network2513#showipCodes:C-connected,S-static,I-IGRP,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaE1-OSPFexternaltype1,E2-OSPFexternaltype2,E-EGPi-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,*-candidatedefaultGatewayoflastresortistonetworkissubnetted,1subnets isdirectlyconnected,Ethernet0 [1/0]via [1/0]viaisvariablysubnetted,2subnets,2 [1/0]via [1/0]viaissubnetted,1subnets isdirectlyconnected,TokenRing0Iftheoriginalstaticroutehadbeentothemajornetwork,theextrastepofconfiguringthedefaultnetworktwicewouldnothavebeennecessary.TherearestillnoIPprotocolsrunninghere.Withoutanydynamicprotocolsrunning,youcanconfigureyourroutertochoosefromanumberofcandidatedefaultroutesbasedonwhethertheroutingtablehasroutestonetworksotherthan/0.Thiscommandallowsyoutoconfigurerobustnessintotheselectionofagatewayoflastresort.Ratherthanconfiguringstaticroutestospecificnext-hops,youcanhavetherouterchooseadefaultroutetoaparticularnetworkbycheckingintheroutingtable.Ifyoulosetheroutetoaparticularnetwork,therouterselectsthesecondcandidatedefault,asspecifiedabove.Youcanremovethelostroutebyremovingthestaticrouteintheconfigurationasfollows:Enterconfigurationcommands,oneperline.EndwithCNTL/Z.2513(config)#noiproute%SYS-5-CONFIG_I:ConfiguredfromconsolebyAfterremovingthestaticroutetotheoriginaldefaultnetwork,theroutingtablelookslikethis:2513#showiprouteCodes:C-connected,S-static,I-IGRP,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaE1-OSPFexternaltype1,E2-OSPFexternaltype2,E-EGPi-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,*-candidatedefaultGatewayoflastresortistonetworkissubnetted,1subnets isdirectlyconnected,Ethernet0 [1/0]via isvariablysubnetted,2subnets,2 [1/0]via [1/0]viaissubnetted,1subnets isdirectlyconnected,TokenRing0UsingDifferentRoutingGatewaysoflastresortselectedusingtheipdefault-networkcommandarepropagateddifferentlydependingonwhichroutingprotocolispropagatingthedefaultroute.ForIGRPandEIGRPtopropagatetheroute,thenetworkspecifiedbytheipdefault-networkcommandmustbeknowntoIGRPorEIGRP.ThismeansthenetworkmustbeanIGRP-orEIGRP-derivednetworkintheroutingtable,orthestaticrouteusedtogeneratetheroutetothenetworkmustberedistributedintoIGRPorEIGRP.RIPadvertisesarouteto.Forexample,notethatthegatewayoflastresortontherouterbelowwaslearnedusingthecombinationoftheiprouteandipdefault-networkcommands.IfyouenableRIPonthisrouter,RIPadvertisesarouteto(althoughnottotheTokenRingnetworkbecauseofsplit-horizon):%SYS-5-CONFIG_I:Configuredfromconsolebyconsole2513#debugipripRIPprotocoldebuggingisonRIP:sendingupdateto55viaEthernet0()default,metric1network,metricRIP:sendingupdateto55viaTokenRing0network,metricNote:InIOSrelease12.0Tandlater,RIPdoesnotadvertisethedefaultrouteriftherouteisnotlearnedviaRIP.Therefore,itmaybenecessarytoredistributetherouteintoRIP,orusethedefault-informationoriginatecommand.OSPF,likeRIP,advertisesaroutefor.However,withOSPF,therouteroriginatingthedefaultroutemustbeconfiguredwiththedefault-informationoriginatecommand.Formoredetailedinformation,seeHowDoesOSPFGenerateDefaultRoutes?.iprouteCreatingastaticroutetonetworkisanotherwaytosetthegatewayoflastresortonarouter.Aswiththeipdefault-networkcommand,usingthestaticroutetoisnotdependentonanyroutingprotocols.However,iproutingmustbeenabledontherouter.Note:IGRPdoesnotunderstandarouteto,thereforeitcannotpropagatedefaultroutescreatedusingtheiproutecommand.Usetheipdefault-networkcommandtohaveIGRPpropagateadefaultroute.EIGRPpropagatesaroutetonetwork,butthestaticroutemustberedistributedintoEIGRP.RIPandOSPFbehaveasdescribedwhenusingtheipdefault-networkcommand.Keepinmindthatthenoteabovestillapplies.LookatanexampleofconfiguringagatewayoflastresortusingtheiprouteEnterconfigurationcommands,oneperline.EndwithCNTL/Z.router-3(config)#iprouterouter-3#showipCodes:C-connected,S-static,I-IGRP,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2,E-EGPi-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,*-candidatedefaultU-per-userstaticroute,o-ODRGatewayoflastresortistonetwork/24issubnetted,2subnetsCisdirectlyconnected,Cisdirectlyconnected,Ethernet0S*/0[1/0]viaNote:Ifyouconfiguremultiplenetworksascandidatedefaultroutesusingtheipdefault-networkcommand,thenetworkthathasthelowestadministrativedistanceischosenasthenetworkforthegatewayof

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(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ǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論