版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 考研英语(阅读)模拟试卷98
- 医院特殊人群医疗服务手册
- 2021年高考历史模拟测试卷0520210220240
- 2026独立站面试题目及答案
- 月下独酌中考试题及答案
- 2026年物业管理员(师)职业能力等级评价考试(物业管理员)综合试题及答案
- 2026年四川省机关事业单位考调、选调工作人员考试(综合知识、综合应用能力测试)测试题及答案
- 2026年青海省全国物业管理师资格考试(物业管理实务)在线自测试题库(建设部)
- 2026年湖北孝感市专业技术职务水平能力测试(新闻)经典试题及答案
- 福建省厦门市部分学校2024-2025学年高一下学期入学考试英语试题(解析版)
- 2026年高考语文备考之60篇背诵古诗文默写高频考查名句汇编
- 四川兆迪水泥窑协同处置一般固废项目环境影响报告表
- 2025~2026学年北京市西城区人教版六年级下学期小升初毕业考试数学试题【含解析】
- 全科医学科慢性病管理指导
- 中粮集团秋招面试题及答案
- 【普通高中数学课程标准】日常修订版-(2017年版2025年修订)
- 土木工程施工课后习题答案
- ISO9001-2026质量管理体系中英文版标准条款全文
- 《土木工程智能施工》课件 第3 章 土方工程-土方开挖与填筑
- 2025向量化与文档解析技术加速大模型RAG应用
- T-JWEA 0001-2025 水利水电工程施工图审查技术导则
评论
0/150
提交评论