版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 中考冲刺个人决心书
- 中秋晚会来宾致辞范文(10篇)
- 中学生竞选班长演讲稿
- 中班家访小结
- 密度应用课件教学课件
- 2025年高考语文复习知识清单第十章作文专题10议论文写作课内素材积累(学生版+解析)
- 渝长一标段动火作业方案
- 超声雾化课件教学课件
- 三年级数学计算题专项练习汇编及答案集锦
- 维修保证金协议书(2篇)
- 医院培训课件:《医疗质量安全核心制度要点解读》
- “四史”(改革开放史)学习通超星期末考试答案章节答案2024年
- 云服务器租赁合同三篇
- 北京市海淀区2023-2024学年高三上学期期末考试 英语 含答案
- 《微项目 探讨如何利用工业废气中的二氧化碳合成甲醇-化学反应的选择与反应条件的优》名校课件
- 《清理厨房》课件劳动四年级下册人教版
- 2024年山东省泰安市中考英语真题(原卷版)
- 人教PEP版(2024)三年级上册英语Unit 5 The colourful world单元整体教学设计(共6课时)
- Unit 3 Sports and Fitness Reading and Thinking 说课教学设计-2023-2024学年高中英语人教版(2019)必修第一册
- 扬州市梅岭教育集团2023-2024学年初一上学期10月数学试卷及答案
- 中医基础理论-初级课件
评论
0/150
提交评论