思科-networkgateway区别在cisco16448中详细地讲解了这三条命令使用条件和_第1页
思科-networkgateway区别在cisco16448中详细地讲解了这三条命令使用条件和_第2页
思科-networkgateway区别在cisco16448中详细地讲解了这三条命令使用条件和_第3页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

ipdefault-network、iproute、ipdefault-gatewaycisco16448ipdefault-gatewayiproutingipdefault-networkiprouteipdefault-networkiproute被路由选择协议出去。ipdefault-network产生的默认路由是可以被EIGRP和RIP的但不被OSPFRIPipdefault-network,debugipripiproute也可以被EIRGP,但是这条静态路由必须重分发到EIGRP协议中;在12.0T以后的IOS版本中,RIP将不默认路由,除非RIPRIP同样,在OSPF中也不能该命令产生的默认路由,(default-informationoriginate)ipdefault-network同时使用ipdefault-networkiproute方设定默认路由时,如果ipdefault-network设定的网络是直连(静态、且已知)的,那么它就成为默认路由;如果ipdefault-network指定的网络是由交换路由信iproute最后,如果使用多条iproute令,则流量会自动在多条链负载均衡。ipdefault-gateway,ipdefault-networkiproute默认路由的区别中遇到了也不犯错了。指定默认路由(lastresortgateway)31、ipdefault-iproutingipdefault-gateway2、ipdefault-networkiproute两者都用于iprouting有效的路由器上,区别主要在于路由协议是否这条路由信息。比如:IGRP无法识别,因此默认路由时必须用ipipdefault-networkadministrativedistance同时使用ipdefault-networkiproute双方设定默认路由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,接着执行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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论