版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
攻城 #^_^# 歸原作者所 本資料供試第1章實(shí)驗(yàn)拓?fù)洹⒔K端服務(wù)器配置本章將首先簡要介紹如何從計(jì)算機(jī)問路由器以對它們進(jìn)行配置,通??梢酝ㄟ^console口或者net來連接路由器。隨后還要介紹本書中一直要用到的網(wǎng)絡(luò)拓?fù)?,并?.1CISCO路由器的方本節(jié)討論前2種。通常console口路由console(rollover)進(jìn)行連接的,反轉(zhuǎn)線通過 路由攻城獅(技術(shù)+生活)vty0vty1,依次類推,路由器通常達(dá)vty4。終端服務(wù)接,就需要經(jīng)常性拔插console線。終端服務(wù)器可以解決這個問題,連接圖如圖1-3。終端服務(wù)器實(shí)際上就是有8個或者16個異步口的路由器,從它引出多條連接線到各個本書實(shí)驗(yàn)拓?fù)?-4(圖中不包含顯示終端服務(wù)器和它們的連接,本書所有的實(shí)驗(yàn)均可以使用該拓?fù)渫瓿?;該拓?fù)溥€可以滿足CCNA和CCNP的絕大多數(shù)實(shí)驗(yàn)、以及CCIE的部分7人共同操作。攻城 #^_^# 歸原作者所 本資料供試拓?fù)渲?臺路由器均為CISCO2821路由器,也可以采用CISCO2801路由器(差別在于CISCO2821CISCO2801的以太網(wǎng)接口為百兆口)IOS采用c2800nm-adventerprisek9-mz.124-11.T1.bin;S1S2Catalyst3560,IOS采用c3560-ipbasek9-mz.122-25.SEB4.bin;S3為Catalyst2950,IOS采用c2950-i6q4l2-mz.121-6.EA2c.bin。拓?fù)渲校?g0/0和交換機(jī)S1進(jìn)行連接;g0/1以太網(wǎng)接口則和交換機(jī)S2進(jìn)行連接。S1和S2交換機(jī)之間通過f0/13f0/14連接;S3交換機(jī)的f0/1接口S1f0/15上,f0/2口連接到S2f0/15上。計(jì)算機(jī)PC1PC2連接到S1交換機(jī)的f0/5和f0/6上;計(jì)算機(jī)PC3PC4則連接到S2f0/5和f0/6上。實(shí)驗(yàn)1:通過console口路由實(shí)驗(yàn)?zāi)康膶?shí)驗(yàn)拓?fù)涔コ仟{(技術(shù)+生活)實(shí)驗(yàn)步驟1-6選擇COM通常路由器出廠時,波特率為9600bps,因此在圖1-7窗口中,點(diǎn)擊【還原為默認(rèn)值】SystemBootstrap,Version12.4(1r)[hqluong1r],RELEASESOFTWARE//以上顯示BOOTROMCopyright(c)2005byCISCOSystems,Initializingmemoryforc2821processorwith262144KbytesofmainMainmemoryisconfiguredto64bitmodewithECCReadonlyROMMONprogramloadcomplete,entrypoint:0x8000f000,size: #####################################################################################[OK]//以上是IOS解壓過程SmartInitisenabledsmartinitissizingiomem 0X003DA000C2821 Onboard0X000021B8OnboardUSB0X002C29F0publicbufferpools publicparticle AsummaryofU.S.laws erningCISCOcryptographicproductsmaybefoundat: Ifyourequirefurtherassistancepleasecontactusbysending.InstalledimageCISCO2821(revision49.46)with249856K/12288Kbytesofmemory.//內(nèi)存大小ProcessorboardIDFHK1039F21Q2GigabitEthernetinterfaces2Low-speedserial(sync/async)interfaces//兩個低速串行口(同步/異步)1VirtualPrivateNetwork()Module//一個網(wǎng)絡(luò)模塊DRAMconfigurationis64bitswidewithparity239Kbytesofnon-volatileconfigurationmemory.NVRAM大62720KbytesofATACompactFlash(Read/Write)//FLASH---SystemConfigurationDialog---Continuewithconfigurationdialog?實(shí)驗(yàn)調(diào)試1-8實(shí)驗(yàn)2:通過net路由實(shí)驗(yàn)?zāi)康膶?shí)驗(yàn)拓?fù)鋵?shí)驗(yàn)步驟
Router#configureEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Router(config)#Routerconfig)#interfaceg0/0Router(config-if)#//以上是進(jìn)入路由器的以太網(wǎng)口g0/0接口,g0/0中g(shù)表示是GigabitEthernet,0/0表示0個插槽0S0/0/00插槽0個模塊上0個串Router(config-if)#ipaddressIPRouter(config-if)#noRouter(config-if)#endRouter#confterminalRouter(config)#linevty0Router(config-line)#passwordCISCO//以上是配置vty的,即netRouter(config-line)#exitRouter(config)#enablepasswordCISCO首先測試計(jì)算機(jī)和路由器的IP連通性,再進(jìn)行net登錄。如下:C:\>ingwith32bytesofReplyfrom:bytes=32time<1msTTL=255Replyfrom:bytes=32time<1msTTL=255Replyfrom:bytes=32time<1msTTL=255Replyfrom:bytes=32time<1msTTL=255statisticsfor:Packets:Sent=4,Received=4,Lost=0(0%loApproximateroundtriptimesinmilli-seconds:Minimum=0ms,um=0ms,Average=C:\>netUserAccessVerification實(shí)驗(yàn)調(diào)試Router#showintGigabitEthernet0/0isup,lineprotocolisHardwareisMV96340Ethernet,addressis0019.5535.b828(biaInternetaddressis實(shí)驗(yàn)3:配置終端服務(wù)實(shí)驗(yàn)?zāi)康膶?shí)驗(yàn)拓?fù)鋵?shí)驗(yàn)步
步驟1:終端服務(wù)器的基本配置Terminal-Server(config)#enablesecretTerminal-Server(config)#noip-Terminal-Server(config)#linevty0<1-15>LastLineTerminal-Server(config)#linevty015Terminal-Server(config-line)#noexec-timeout 超時自動logout出來Terminal-Server#confEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Terminal-Server(config)#interfacef0/0Terminal-Server(config-if)#ipaddress26Terminal-Server(config-if)#noshutdown攻城 #^_^# 歸原作者所 本資料供試Terminal-Server(config)#noiproutingTerminal-Server(config)#ipdefault-gateway54Terminal-Server#showlineTty AModemRotyAccO Noise *0 00-* 63-* 10-* 10-* 5-* 10-* 07- 1- 00- 00- 00- 00- 00- 00- 00- 00- 00- 00-* 60-* 20-* 20-* 50-* 0- 20- 00- 00- 00- 00- 00- 00- 00- 00- 00- 00-//以上是查看終端服務(wù)器上異步模塊的各異步口所在的線路編號,tty表示的就是異步模攻城獅(技術(shù)+生活)Terminal-Server#confEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Terminal-Server(config)#line3348Terminal-Server(config-if)#ipaddress//以上配置loopback0接口的ip地址,loopback接口是一個邏輯上的接口,路由器上可以任意創(chuàng)建幾乎無窮多的loopback接口,該接口可以是UP的。loopback接口經(jīng)常用于測我們可以采用:“net2033”命令。然而這樣命令很長,為了方便,所以我們使用“iphost”命令定義一系列的主機(jī)名,這樣可以之間輸入“R1”控制line33線Terminal-Server(config)#privilegeexeclevel0clearlineTerminal-Server(config)#privilegeexeclevel0clear//以上是使得我們在用戶模式下也能使用“clearline”和“clear”命Terminal-Server(config)#bannermotdEnterTEXTmessage.EndwiththecharacterR1------- cr1------clearlineR2------- cr2------clearlineR3------- cr3------clearlineR4------- cr4------clearlineS1------- cs1------clearlineS2------- cs2------clearlineS3------- cs3------clearline#口。首先測試計(jì)算機(jī)和路由器的IP連通性,再進(jìn)行net登錄。如下:C:\sandSettings\longkey>26ing26with32bytesofReplyfrom26:bytes=32time<1msTTL=255Replyfrom26:bytes=32time<1msTTL=255Replyfrom26:bytes=32time=1msTTL=255Replyfrom26:bytes=32time=18msstatisticsfor26:Packets:Sent=4,Received=4,Lost=0(0%Approximateroundtriptimesinmilli-seconds:Minimum=0ms,um=18ms,Average= sandSettings\longkey>net cr1------clear cr2------clear cr3------clear cr4------clear cs1------clear cs2------clear cs3------clearTryingR1(,2033)... cr1------clear cr2------clear cr3------clear cr4------clear cs1------clear cs2------clear cs3------clearTryingR1(,%Connectionrefusedbyremote重復(fù)步驟(3),可以打開不同路由器或者交換機(jī)的控制窗口,這樣我們就可以在一臺計(jì)1-11。當(dāng)然,一臺路由器只能被一臺計(jì)算SecureCRT紹了如何配置路由器以使管理員能夠通過net配置路由器。還介紹如何配置終端訪1configureinterfaceipaddressnolinevty0vty0vtypasswordenablepasswordshowinthostnameTerminal-enablesecretnoip-loggingnoipipdefault-gatewayshowline33transportinputintiphostR12033aliasexeccr1clearlineprivilegeexeclevel0clearbanner2由器基本路由器簡介和IOS路由器簡介PCCPU、內(nèi)存、BOOTROM。路由器沒有鍵RAM/DRAM:內(nèi)存,用于臨時的運(yùn)算結(jié)果,如:路由表、ARP表、快速交換緩存、緩沖數(shù)據(jù)包、數(shù)據(jù)隊(duì)列、當(dāng)前配置。眾所周知,RAMFLASH:可擦除、可編程的ROM,用于存放路由器的IOS,F(xiàn)LASH的可擦除特性允許我們更新、升級IOS而不用更換路由器內(nèi)部的。路由器斷電后,F(xiàn)LASH的內(nèi)容不會丟失。FLASH容量較大時,就可以存放多個IOS版本。NVRAM:非易失性RAM,用于存放路由器的配置文件,路由器斷電后,NVRAM中的內(nèi)容仍,ROM(InterfaceIOS簡介System算機(jī)上的Windows一樣,IOS是路由器的,所有配置是通過IOS完成的。Cisco的IOS是命令行界面(CLI,CommandLineInterface,CLI(1)用戶模式(Usermode:通常用來查看路由器的狀態(tài)。在此狀態(tài)下,無法對路由器進(jìn)(2)模式(Privilegemode:可以更改路由器的配置,當(dāng)然也可以查看路由器的所有2-1常用的編輯命令【Crtl+A【Crtl+E【Esc+F【Esc+B【Crtl+F【Crtl+B2-2配置文件的流動雖然是命令行,CLI2-1,熟悉它們是熟練配置路由部件間流動,流動如圖2-2所示。路由器的IOS是如此重要,因此我們也需要通過TFTP服務(wù)器把IOS備份到計(jì)算機(jī)上。由于各種各樣的原因,我們可能會不破壞了IOS,造成路由器無法開機(jī),可以通過TFTPIOS進(jìn)行恢復(fù)。如果不慎忘記了路由器的,也可以進(jìn)行恢復(fù)。2-3Cisco(PowerOnSelfTest,POST,診ROM(BootstrapLoader)BIOSBootstrapIOS裝到RAMIOS可以存放在許多地方(FLASH、TFTP服務(wù)器上或ROM中IOS映像的順序,取決于配置寄存器的啟動域以及其他的設(shè)置。配置寄存器(configurationregister)是一個16位(2進(jìn)制)的寄存器,低4位就是啟動域,不同的值代表從不同IOS,2-2IOS2-42-2012-2-4路由器查找IOSCDP協(xié)議介CDP(CiscoDiscoveryProtocol)協(xié)議是Cisco專有的協(xié)議,是使Cisco網(wǎng)絡(luò)設(shè)備能夠發(fā)現(xiàn)相鄰的、直連的其他Cisco設(shè)備的協(xié)議。CDP是數(shù)據(jù)鏈路層的協(xié)議,因此使用不同的網(wǎng)絡(luò)層協(xié)議的Cisco設(shè)備也可以獲得對方的信息。CDP協(xié)議默認(rèn)是啟動的。實(shí)驗(yàn)1:CLI的使用與IOS基本命實(shí)驗(yàn)?zāi)繉?shí)驗(yàn)拓實(shí)驗(yàn)步
用戶模式進(jìn)入到模式,“disable”命令則相反,在模式下的提示符為“#”。Translating"clok"...server(55)Translating"clok"...server%Unknowncommandorcomputername,orunabletofindcomputerclearclock pleteRouter#clock?setSetthetimeandRouter#clockset?hh:mm:ssCurrentTimeRouter#clockset11:36:00 pletecommand.Router#clockset11:36:00?<1-31>Dayofthemonth MonthoftheRouter#clockset11:36:0012?MONTHMonthoftheyearRouter#clockset11:36:001208^%Invalidinputdetectedat'^'Router#clockset11:36:0012august pleteRouter#clockset11:36:0012august2003Router#showclock11:36:03.149UTCTueAug12Router#?Execcommands: CreateatemporaryAccess-Listentry Applyuser-profiletointerfaceaccess-temteCreateatemporaryAccess-Listentry Erasea Exitfromthe攻城 #^_^# 歸原作者所 本資料供試 Descriptionoftheinctivehelp%Ambiguouscommand:"dis"disable“disconnect”。若再加多一個字母“a”就可以區(qū)分了。Router#configureterminalRouter#showhistoryconfshowhistoryconftshow使用表2-1的編輯鍵移動光標(biāo)Router#terminalhistorysizeRouter#terminalnoeditingRouter#terminal連接到R1Router#configureEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Router(config)#hostnameR1R1(config)#enablepasswordciscoR1(config)#interfaceR1(config-if)#ipaddressR1(config-if)#noR1(config-if)#ipaddressR1(config-if)#noR1(config-if)#end(或【Ctrl+ZR1#copyrunning-configstartup-configDestinationfilenamestartup-config]?Buildingconfiguration...Enterconfigurationcommands,oneperline.EndwithCNTL/Z.Router(config)#hostnameR2R2(config)#enablepasswordciscoR2(config)#interfaceg0/0R2(config-if)#ipaddressR2(config-if)#noshutdownR2(config-if)#ipaddressR2(config-if)#clockrateR2(config-if)#noshutdownR2#copyrunning-configstartup-Destinationfilename[startup-config]?Buildingconfiguration...R2#TypeescapesequencetoSending5,100-byteICMPEchosto26,timeoutis2Successrateis100percent(5/5),round-tripmin/avg/max=1/1/4R2#showversionCiscoIOSSoftware,2800Software(C2800NM-ADVENTERPRISEK9-M),Version12.4(11)T1,RELEASESOFTWARE(fc5)TechnicalSupport:ht Copyright(c)1986-2007byCiscoSystems,Inc.CompiledThu25-Jan-0712:50byROM:SystemBootstrap,Version12.4(1r)[hqluong1r],RELEASESOFTWARER2uptimeis4hours10minutesSystemreturnedtoROMbypower-onSystemimagefileis"flash:c2800nm-adventerprisek9-mz.124-Ifyourequirefurtherassistancepleasecontactusbysending.Cisco2821(revision53.50)with249856K/12288Kbytesof//注:以上是路由型號、RAM大小(249856K ProcessorboardIDFHK1039F1FG//主板系列號2GigabitEthernet4Low-speedserial(sync/async)interfaces1VirtualPrivateNetwork()ModuleDRAMconfigurationis64bitswidewithparityenabled.239Kbytesofnon-volatileconfigurationmemory.62720KbytesofATACompactFlashConfigurationregisterisR2#showrunning-configBuildingconfiguration...Currentconfiguration:1238!versionservicetimestampsdebugdatetimemsecservicetimestampslogdatetimemsecnoservicepassword-encryption!hostname R2#showstartup-configBuildingconfiguration...Currentconfiguration:1238!versionR2#showinterfaceSerial0/0/0isup,lineprotocolisup HardwareisGT96KSerialInternetaddressis/24IPMTU1500bytes,BW128Kbit,DLY20000usec,reliability255/255,txload1/255,rxload1/255//注:以上是該接口的MTU、帶寬、延時、可靠性、負(fù)載大小EncapsulationHDLC,loopbacknotsetHDLCKeepaliveset(10sec) R2#showflashFile bytesused, 62720KbytesofATACompactFlash(Read/Write)R2#showcontrollerss0/0/0InterfaceSerial0/0/0HardwareisGT96KDCEV.35,clockrateidbat0x4728A8C0,driverdatastructureat0x4728CBECwic_info0x4728D218PhysicalPort1,SCCNumR2#showipHardware-3實(shí)驗(yàn)2:配置文件的備份和IOS的備實(shí)驗(yàn)?zāi)繉?shí)驗(yàn)拓實(shí)驗(yàn)步
2-7TFTPServerTftp服務(wù)器軟件有各種各樣,本書以SolarWindsTFTPServer軟件為例,該軟件可以 TFTP的主為c:\tftp-root,TFTPServer的文件將存放在該,也從該查找要發(fā)送的文件。如圖2-9,在“SecurityTFTP2-8查看TFTP2-9TFTPServerSwitch#erasestartup-configR2(config)#intg0/0R2(config-if)#noR2(config-if)#ipaddress TypeescapesequencetoSending5,100-byteICMPEchosto00,timeoutis2Successrateis100percent(5/5),round-tripmin/avg/max=1/1/4R2#copyrunning-configAddressornameofremotehost00//回答TFTPIPDestinationfilename[r2- 1381bytescopiedin0.452secs(3055//備份成功,共1381字節(jié),可以在c:\tftp-root FTPshowrunning-config”命令顯示當(dāng)前的配置,在終端窗口中全部配置,粘貼到某文本文件中。R2#showCompactFlashFile bytesused, 62720KbytesofATACompactFlash(Read/Write)R2#copyflash:c2800nm-adventerprisek9-mz.124-11.T1.binAddressornameofremotehost Destinationfilename[c2800nm-adventerprisek9-mz.124- 實(shí)驗(yàn)3:恢復(fù)和IOS的恢實(shí)驗(yàn)?zāi)繉?shí)驗(yàn)拓實(shí)驗(yàn)步驟Router#configureterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Router(config)#hostnameR2R2(config)#enablepassword由器的啟動過程,進(jìn)入rommon模式,如下:SystemBootstrap,Version12.4(1r)[hqluong1r],RELEASESOFTWARE(fc1)Copyright(c)2005byciscoSystems,Inc.Initializingmemoryforc2821processorwith262144KbytesofmainMainmemoryisconfiguredto64bitmodewithECCenabledReadonlyROMMONinitializedrommon1>confregrommon2>退出setup模式。Router#copystartup-configrunning-configDestinationfilename[running-config]?661bytescopiedin0.625R2#configureterminalR2(config)#enablepasswordciscoR2(config)#config-registerR2#copyrunning-configstartup-Destinationfilename[startup-config]?Buildingconfiguration...【提示】在保存配置前,還需要把路由器的各個接口一一打開R2#showflash:CompactFlashFile bytesused, 62720KbytesofATACompactFlash(Read/Write)//顯示flash中的R2#deleteflash:c2800nm-adventerprisek9-mz.124-11.T1.binDeletefilename[c2800nm-adventerprisek9-mz.124-11.T1.bin]?用“copytftpflash”命令從TFTP服務(wù)器恢復(fù)IOS,這比起我們下面介紹的方法簡單得多。IOSc:\TFTP-RootIOS2>2>3>4>5>6>TFTP_FILE=c2800nm-adventerprisek9-mz.124-TFTP服務(wù)器在同一網(wǎng)段是不需要網(wǎng)關(guān)的,但是不能不配置該值,所以我們把DEFAULT_GATEWAY胡亂地指向了TFTP服務(wù)器。請注意變量名的大小寫。rommon8>//開始從tftp恢復(fù)IP_ADDRESS:IP_SUBNET_MASK:DEFAULT_GATEWAY:TFTP_SERVER:TFTP_VERBOSE:ProgressTFTP_RETRY_COUNT:TFTP_TIMEOUT:7200TFTP_CHECKSUM:YesTFTP_MACADDR:00:19:55:66:63:20GE_PORT:GigabitEthernet0GE_SPEED_MODE:AutoInvokethiscommandfordisasterrecoveryWARNING:allexistingdatainallpartitionsonflashwillbelost!Doyouwishtocontinue?y/n:[n]:y//回答“y”開始從tftp服務(wù)器上恢復(fù)IOS,根據(jù)IOS的大小,通常需要十幾分鐘 00!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Filereceptioncompleted.Validatingchecksum.Copyingfilec2800nm-adventerprisek9-mz.124-11.T1.bintoflash.rommon9>實(shí)驗(yàn)?zāi)?/p>
實(shí)驗(yàn)拓?fù)鋵?shí)驗(yàn)步驟步驟1:打開接口R1(config)#intg0/0R1(config-if)#ints0/0/0攻城 #^_^# 歸原作者所 本資料供試R2(config)#intg0/0R2(config-if)#ints0/0/0R2(config-if)#noR2(config-if)#clockrateR1#showGlobalCDPinformation:GlobalCDPinformation:SendingCDPpacketsevery60secondsSendingaholdtimevalueof180secondsSendingCDPv2advertisementsisenabled180秒R1#showcdpGigabitEthernet0/0isup,lineprotocolisupEncapsulationARPASendingCDPpacketsevery60secondsHoldtimeis180secondsGigabitEthernet0/1isadministrativelydown,lineprotocolisdownEncapsulationARPASendingCDPpacketsevery60secondsHoldtimeis180secondsSerial0/0/0isdown,lineprotocolisdownEncapsulationHDLCSendingCDPpacketsevery60secondsHoldtimeis180secondsSerial0/0/1isadministrativelydown,lineprotocolisdownEncapsulationHDLCSendingCDPpacketsevery60secondsHoldtimeis180secondsR1#showDeviceLocalPortSerRSSerGigSWS-FasDevice消息的時間采用倒計(jì)時;“Capability表明鄰居是什么設(shè)、二CapabilityCodes對各符號進(jìn)行了說明;“tform”指明了鄰居的硬件型號“PortID”指明了R1是連接對R1#showcdpentryDeviceID:R2Entryaddress(es):tform:Cisco2821,Capabilities:RouterSwitchIGMPInterface:Serial0/0/0,PortID(outgoingport):Serial0/0/0Holdtime:158secVersionCiscoIOSSoftware,2800Software(C2800NM-ADVENTERPRISEK9-M),Version12.4(11)T1,RELEASESOFTWARE(fc5)TechnicalSupport:ht Copyright(c)1986-2007byCiscoSystems,Inc.CompiledThu25-Jan-0712:50byprod_rel_teamadvertisementversion:2VTPManagement:R1#clearcdp//清除CDPR1(config)#intg0/0R1(config-if)#nocdpenableR1(config)#nocdp R1(config)#cdprun cdpR1(config)#cdptimer30CDP30R1(config)#cdpholdtime120R1#showGlobalCDPSendingCDPpacketsevery30secondsSendingaholdtimevalueof120secondsSendingCDPv2advertisementsis的恢復(fù),IOS的備份和恢復(fù)。表2-3是本章出現(xiàn) clockterminalnoterminalterminalhistorysizecopyrunning-configstartup-clockrateinterfaceshowcontrollersipcopyrunning-configcopytftprunning-1.T1.binconfregicopystartup-configrunning-config-registertftpcdpcdpcdpentryclearcdpnocdpnocdprun/cdpcdptimercdpholdtime3態(tài)路靜態(tài)路由與默認(rèn)路由靜態(tài)路由介紹路由器在轉(zhuǎn)發(fā)數(shù)據(jù)時,要先在路由表(routingtable)中查找相應(yīng)的路由。路由器有改變路由表;然而靜態(tài)路不會占用路由器太多的CPU和RAM資源,也不占用線路的帶寬。如果iproute目的網(wǎng)絡(luò)掩碼{網(wǎng)關(guān)地址|接口}例子:iproute例子:iproute接口都是可以的;然而如果鏈路是多路的鏈路(例如以太網(wǎng),則只能采用網(wǎng)關(guān)地址,即不能:iproutef0/0?!咎崾尽縄OSiproutef0/0時,路由器也是正常工作的,然而這是ARP的功勞,建議不要采用該形式。在路由器上,可以使用“showiproute”命令查看路由表。如下:R1#showiprouteCodes:C-connected,S-static,I-IGRP,R-RIP,M-,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2,E-i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinter*-candidatedefault,U-per-userstaticroute,o-ODRP-periodicdownloadedstaticrouteGatewayoflastresortisnot /16[120/2]via,00:00:21,[120/2]via,00:00:06,/16issubnetted,4 [120/1]via,00:00:21, isdirectlyconnected,Serial0/1 isdirectlyconnected, [120/1]via,00:00:06, /24isdirectlyconnected,在輸出中,首先顯示路由條目各種類型的的簡寫,如:“C為直連網(wǎng)絡(luò),“S(Metric近一次得知路由到現(xiàn)在的時間;“Serials0/0”是指到達(dá)下一跳應(yīng)從哪個端口出去。【技術(shù)要點(diǎn)】管理距離(AD“10..0.0/24RIP3-113-1路由協(xié)議管理距離01(Metric:默認(rèn)路由介紹3-1InternetR2命令為:iproute{網(wǎng)關(guān)地址|接口}例子:iproute例子:iprouteip
3-1(Stub3-2ipclassless3-2R1iproutes0/0/0R1路由器是否會把到達(dá)/24網(wǎng)絡(luò)的數(shù)據(jù)從s0/0/0接口發(fā)送出去?這取決于是否執(zhí)行了“ipclassless”命令。如果執(zhí)行了“ipclassless”命令(實(shí)際上這是默認(rèn)值,則路如果執(zhí)行了“noipclassless”命令,當(dāng)路由器存在一主類網(wǎng)絡(luò)的某一子網(wǎng)路由時,達(dá)/24子網(wǎng)的數(shù)據(jù)包不會使用默認(rèn)路由進(jìn)行發(fā)送。然而如果數(shù)據(jù)包是要到達(dá)/24,默認(rèn)路由會被采用,因?yàn)镽子網(wǎng)的路由。實(shí)驗(yàn)1:靜態(tài)路實(shí)驗(yàn)?zāi)繉?shí)驗(yàn)拓實(shí)驗(yàn)步R1(config)#intR1(config-if)#ipaddressR1(config)#ints0/0/0R1(config-if)#ipaddressR1(config-if)#noshutdownR2(config)#intR2(config-if)#ipR2(config)#intR2(config-if)#clockR2(config-if)#ipR2(config)#ints0/0/1R2(config-if)#clockrateR2(config-if)#ipaddressR2(config-if)#noshutdownR3(config)#intR3(config-if)#ipaddressR3(config)#ints0/0/1R3(config-if)#ipaddressR3(config-if)#noshutdownR1(config)#iprouteR1(config)#iprouteR2(config)#iprouteR2(config)#iprouteR3(config)#iprouteR3(config)#iproute實(shí)驗(yàn)調(diào)試R1#showipCodes:C-connected,S-static,R-RIP,M-,B-D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnot /24isdirectlyconnected,Serial0/0/0/24issubnetted,1subnets isdirectlyconnected,Loopback0/24issubnetted,1subnets isdirectlyconnected,Serial0/0/0/24issubnetted,1subnets [1/0]viaR2#showipCodes:C-connected,S-static,R-RIP,M-,B-D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnot /24isdirectlyconnected,Serial0/0/0/24issubnetted,1subnets isdirectlyconnected,Serial0/0/0/24issubnetted,1subnets isdirectlyconnected,Loopback0/24issubnetted,1subnets isdirectlyconnected, /24isdirectlyconnected,R3#showipCodes:C-connected,S-static,R-RIP,M-,B-D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset/24issubnetted,1subnets isdirectlyconnected,Serial0/0/1/24issubnetted,1subnets isdirectlyconnected,Serial0/0/1/24issubnetted,1subnets isdirectlyconnected, /24isdirectlyconnected,ProtocolTargetIPaddress: //目標(biāo)IPRepeatcount //發(fā)送的次Datagramsize Timeoutinseconds Extendedcommands[n]:y//是否進(jìn)一步擴(kuò)展Sourceaddressorinterface:IP地址Typeofservice[0]:SetDFbitinIPheader?Validatereplydata?DatapatternLoose,Strict,Record,Timestamp,SweeprangeofsizesTypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2PacketsentwithasourceaddressofSuccessrateis100percent(5/5),round-tripmin/avg/max=12/14/16R1#sourceloopback0TypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2PacketsentwithasourceaddressofSuccessrateis100percent(5/5),round-tripmin/avg/max=12/14/16R2#sourceloopbackR2#sourceloopbackR3#sourceloopbackR3#sourceloopback口【提示】雖然從R1的loopback0可以通R3的loopback0,數(shù)據(jù)需要經(jīng)過/24R1/24發(fā)數(shù)據(jù)包完成是根據(jù)路由表的,并且數(shù)據(jù)是一跳一跳地被轉(zhuǎn)發(fā)的,就像接力賽似的。從R1,口從R1上、從R1上R1#TypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2Successrateis100percent(5/5),round-tripmin/avg/max=12/14/16//可以通R1#TypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2Successrateis0percent送。即:數(shù)據(jù)包從R1R3R1。實(shí)驗(yàn)2:默認(rèn)路實(shí)驗(yàn)?zāi)繉?shí)驗(yàn)拓實(shí)驗(yàn)步R1(config)#noiprouteR1(config)#noiprouteR3(config)#noiprouteR3(config)#noiproute2:R1、R3R1(config)#iprouteR3(config)#iproute實(shí)驗(yàn)調(diào)試 實(shí)驗(yàn)?zāi)縤p實(shí)驗(yàn)拓實(shí)驗(yàn)步
3-4實(shí)驗(yàn)3R1(config)#interfaceLoopback0R1(config-if)#ipaddressR1(config)#interfaceSerial0/0/0R1(config-if)#noR1(config-if)#ipaddressR1(config)#ipclasslessR1(config)#iprouteR2(config-if)#ipaddressR2(config)#interfaceSerial0/0/0R1(config-if)#noR2(config-if)#ipaddressR2(config-if)#clockrate128000R1(config)#ipclasslessR2(config)#iproute測試從R1R2的loopback0接R1#TypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2Successrateis100percent(5/5),round-tripmin/avg/max=12/13/16 2:執(zhí)行“noipclassless”R1(config)#noipcef//關(guān)閉ipcef,防止影響我們的測試,CEFR1(config)#noipclasslessR1#TypeescapesequencetoSending5,100-byteICMPEchosto,timeoutis2Successrateis0percent中,處于局域網(wǎng)和Internet邊界的路由器通常會使用它。表3-2是本章出現(xiàn)令。ipshowipipclassless/noipsourceloopback04動態(tài)路由協(xié)議包括距離向量路由協(xié)議和鏈路狀態(tài)路由協(xié)議。RIP(RoutingInformationProtocols,路由信息協(xié)議)是使用最廣泛的距離向量路由協(xié)議。RIPRIP4-1RIPv1RIPv2區(qū)VLSM實(shí)驗(yàn)1:RIPv1基本配R1(config)#router//啟動RIP1//配置RIPR2(config)#router1R3(config)#router1R4(config)#router14.實(shí)驗(yàn)調(diào)(1)showipR1#showipCodes:C-connected,S-static,R-RIP,M-,B-D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnot /24isdirectlyconnected,Serial0/0/0/24issubnetted,1subnets isdirectlyconnected, /8[120/3]via,00:00:03, /24[120/1]via,00:00:03,Serial0/0/0 /24[120/2]via,00:00:03,⑤⑦(2)showipR1#showip【注意RoutingProtocolis//路由器上運(yùn)行的路由協(xié)議是OutgoingupdatefilterlistforallinterfacesisnotingupdatefilterlistforallinterfacesisnotSendingupdatesevery30seconds,nextduein23【注意為了防止更新同步,RIP15%的誤差發(fā)送更新,即實(shí)際發(fā)送更新的周期的范圍是25.5-30秒。Invalidafter180seconds,holddown180,flushedafter【技術(shù)要點(diǎn) /8ispossiblydown,routingvia, 秒【提示R1(config-router)#timersbasicupdateinvalidholddownRedistributing:Defaultversioncontrol:sendversion1,receiveversionRecvTriggeredRIPKey-1111Automaticnetworksummarizationisinumpath:【提示R1(config-router)#um-pathsnumber-Routingfor//以上三行表明RIPRoutingInformationLast//distance:管理//lastupdate:更新發(fā)生在多長時間以前Distance:(defaultis120)debugipR1#cleariproute*R1#debugipripFeb912:43:13.311:RIP:sendingrequestonSerial0/0/0to912:43:13.315:sendingrequestonLoopback0to912:43:13.323:receivedv1updatefromon9in39in19in2Feb912:43:15.311:RIP:sendingv1flashupdateto55viaLoopback0()Feb912:43:15.311:RIP:buildflashupdateentriesFeb9 networkmetricFeb9 networkmetricFeb9 networkmetricFeb9 networkmetric 912:43:15.311:RIP:sendingv1flashupdateto55viaSerial0/0/0Feb912:43:15.311:RIP:buildflashupdateentriesFeb912:43:15.311: networkmetric1通過以上輸出,可以看到RIPv1采用廣播更新(55),分別向Loopback0和s0/0/0發(fā)送路由更新,同時從s0/0/0接收三條路由更新,分別是,度量值是3跳;,度量值是2跳;,度量值是1跳?!炯夹g(shù)要點(diǎn)flashupdate(閃式更新)指的是當(dāng)網(wǎng)絡(luò)上某個路徑的度量值發(fā)生變化,路由器立即實(shí)驗(yàn)2:接口與單播更拓?fù)浣Y(jié)圖4-2配置接由于以太口g0/0和g0/1連接主機(jī),不需要向這些接口發(fā)送路由更新,所以可以考慮將路由器的該接口設(shè)置為接口。步驟1:配置路由器R1R1(config)#routerripR1(config-router)#passive-interface步驟2:配置路由器R2R2(config)#routerripR1#debugipripR1#cleariproute*Feb913:24:41.275:RIP:sendingrequestonSerial0/0/0to55Feb913:24:41.283:RIP:receivedv1updatefromonSerial0/0/0Feb913:24:41.283: in1hops 913:24:43.275:RIP:sendingv1flashupdateto55viaSerial0/0/0Feb913:24:43.275:RIP:buildflashupdate9networkmetric9networkmetric【技術(shù)要點(diǎn)【實(shí)例用單播更新,為指定的相鄰路由器R3R1具體的配置如下:R1(config)#routerR1(config-router)#neighbor4-3實(shí)驗(yàn)3:使用子網(wǎng)地址實(shí)驗(yàn)?zāi)坎襟E1:配置路由器R1R1(config)#routerrip步驟2:配置路由器R2R2(config)#routerripR1#showipCodes:C-connected,S-static,R-RIP,M-,B-D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnot/24issubnetted,3isdirectlyconnected,Loopback0 isdirectlyconnected,Serial0/0/0 [120/1]via,00:00:03,R2#showipCodes:C-connected,S-static,R-RIP,M-,B--EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnot/24issubnetted,3 [120/1]via,00:00:21, isdirectlyconnected,Serial0/0/0 isdirectlyconnected,Loopback0可以說明,某些情況下RIPv1更新確實(shí)可以攜帶子網(wǎng)信息?!炯夹g(shù)要點(diǎn)【思考R2#showipCodes:C-connected,S-static,R-RIP,M-,B-D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticroute攻城 #^_^# 歸原作者所 本資料供試Gatewayoflastresortisnot/16isvariablysubnetted,3subnets,2 /25[120/1]via,00:00:17,/25isdirectlyconnected,Serial0/0/0 /24isdirectlyconnected,Loopback0實(shí)驗(yàn)4:RIPv2基本配步驟1:配置路由器R1R1(config)#routerrip步驟2:配置路由器R2R2(config)#routerripR2(config-router)#noauto-summary步驟3:配置路由器R3R3(config)#routerripR3(config-router)#noauto-summary步驟4:配置路由器R4R4(config)#routerrip攻城獅(技術(shù)+生活)(1)showipR1#showipCodes:C-connected,S-static,R-RIP,M-,B--EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnot /24isdirectlyconnected,Serial0/0/0/24issubnetted,1subnets isdirectlyconnected,Loopback0/8isvariablysubnetted,2subnets,2masks /24[120/3]via,00:00:22,Serial0/0/0 /24[120/1]via,00:00:22,Serial0/0/0 /24[120/2]via,00:00:22,從上面輸出的路由條目“/24”,可以看RIPv2路由更新是攜帶子網(wǎng)信息的(2)showipprotocolsR1#showipprotocolsRoutingProtocolis"rip"OutgoingupdatefilterlistforallinterfacesisnotsetingupdatefilterlistforallinterfacesisnotSendingupdatesevery30seconds,nextduein19secondsInvalidafter180seconds,holddown180,flushedafter240Redistributing:ripDefaultversioncontrol:sendversion2,receiveversionRecvTriggeredRIPKey-2222【提示可以通過命令“ipripsendversion”和“ipripreceiveversion”來控制在路由器接口上接收和發(fā)送的版本,例如在s0/0/0接口上接收版本1和2的路由更新,但是只發(fā)送版本2的路由更新,配置如下:R1(config-if)#ipripsendversion2R1(config-if)#ipripreceiveversion1【注意但是如果在接口上配置了“ipripreceiveversion121Automaticnetworksummarizationisnotineffectumpath:4RoutingforRoutingInformationLastDistance:(defaultis實(shí)驗(yàn)5:RIPv2手工匯R4(config)#routerripR4(config-router)#version2R4(config-router)#noauto-summaryR4(config)#interfaces0/0/0R4(config-if)#ipsummary-addressrip//RIP手工路R1#showipCodes:C-connected,S-static,R-RIP,M-,B-D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNS
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 《家裝知識講座》課件
- 《癲癇本科》課件
- 《家族式增員》課件
- 單位管理制度合并選集【人員管理篇】
- 單位管理制度范例選集人事管理篇十篇
- 《投資經(jīng)濟(jì)學(xué)》課程教學(xué)大綱
- 《現(xiàn)代經(jīng)濟(jì)學(xué)》課程教學(xué)大綱1
- 《小學(xué)分?jǐn)?shù)教學(xué)》課件
- 《電子元件基礎(chǔ)知識》課件
- 《企業(yè)環(huán)保管理》課件
- 流行病學(xué)知識考核試題題庫與答案
- DB11-T212-2017園林綠化工程施工及驗(yàn)收規(guī)范
- 小學(xué)數(shù)學(xué)自制教具學(xué)具的研究及探討
- 廣東省幼兒園一日活動指引(試行)
- 光學(xué)材料-光學(xué)加工流程
- 奔馳卡車產(chǎn)品分析(課堂PPT)
- 反循環(huán)鉆孔灌注樁施工方案
- 新能源小客車購車充電條件確認(rèn)書
- 發(fā)明專利專利答辯模板
- 市政府副市長年道路春運(yùn)工作會議講話稿
- 鑄鐵鑲銅閘門
評論
0/150
提交評論