




已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
网络工程师交换试验手册之一:路由器的基本配置实验目的: 熟悉路由器的基本操作 路由器的3种工作模式 为路由器定义名称 为路由器添加特权密码 启用控制台密码 为TELNET访问启用密码 不执行DNS解析l 配置路由器,使得控制台端口不会中止你的连接 配置路由器,使得路由器发送的控制台屏幕的消息不会附加到命令行中 配置路由器,使得当登陆控制台端口的时候显示一个标题。 为路由器接口配置IP地址。 查看配置结果。实验拓扑:01.JPG (19.51 KB)2007-6-25 09:57实验内容:attach/attach1.路由器的3种用户模式用户模式 Router Router? 观察命令的多少Exec commands:access-enable Create a temporary Access-List entryaccess-profile Apply user-profile to interfaceclear Reset functionsconnect Open a terminal connectiondisable Turn off privileged commandsdisconnect Disconnect an existing network connectionenable Turn on privileged commandsexit Exit from the EXEChelp Description of the interactive help systemlat Open a lat connectionlock Lock the terminallogin Log in as a particular userlogout Exit from the EXECmrinfo Request neighbor and version information from a multicast routermstat Show statistics after multiple multicast traceroutesmtrace Trace reverse multicast path from destination to sourcename-connectionName an existing network connectionpad Open a X.29 PAD connectionping Send echo messagesppp Start IETF Point-to-Point Protocol (PPP)resume Resume an active network connectionrlogin Open an rlogin connectionshow Show running system informationslip Start Serial-line IP (SLIP)systat Display information about terminal linestelnet Open a telnet connectionterminal Set terminal line parameterstn3270 Open a tn3270 connectiontraceroute Trace route to destinationtunnel Open a tunnel connectionudptn Open an udptn connectionwhere List active connectionsx28 Become an X.28 PADx3 Set X.3 parameters on PADxremote Enter XRemote mode特权模式Routerenable (进入特权模式)Router#进入特权模式中,我们可以观察出特权模式与用户模式的不同在于对命令的使用权限的不同.Router#?Exec commands:access-enable Create a temporary Access-List entryaccess-profile Apply user-profile to interfaceaccess-templateCreate a temporary Access-List entryarchive manage archive filesbfe For manual emergency modes settingcd Change current directoryclear Reset functionsclock Manage the system clockconfigure Enter configuration modeconnect Open a terminal connectioncopy Copy from one file to anotherdebug Debugging functions (see also undebug)delete Delete a filedir List files on a filesystemdisable Turn off privileged commandsdisconnect Disconnect an existing network connectionenable Turn on privileged commandserase Erase a filesystemexit Exit from the EXEChelp Description of the interactive help systemlat Open a lat connectionlock Lock the terminallogin Log in as a particular userlogout Exit from the EXECmore Display the contents of a filemrinfo Request neighbor and version information from a multicast routermstat Show statistics after multiple multicast traceroutesmtrace Trace reverse multicast path from destination to sourcename-connectionName an existing network connectionno Disable debugging functionspad Open a X.29 PAD connectionping Send echo messagesppp Start IETF Point-to-Point Protocol (PPP)pwd Display current working directoryreload Halt and perform a cold restartrename Rename a filerestart Restart Connectionresume Resume an active network connectionrlogin Open an rlogin connectionrsh Execute a remote commandsend Send a message to other tty linessetup Run the SETUP command facilityshow Show running system informationslip Start Serial-line IP (SLIP)start-chat Start a chat-script on a linesystat Display information about terminal linestelnet Open a telnet connectionterminal Set terminal line parameterstest Test subsystems, memory, and interfacestn3270 Open a tn3270 connectiontraceroute Trace route to destinationtunnel Open a tunnel connectionudptn Open an udptn connectionundebug Disable debugging functions (see also debug)verify Verify a filewhere List active connectionswrite Write running configuration t配置模式 Router#configt(进入配置模式)Router(config)#接口模式Router(config)#interface type number(选择要进入的接口)Router(config)#interface ethernet 0 进入以太网E0接口Router(config-if)#为路由器定义名称 router(config)#hostname xxx(xxx为我们定义的名称)Router(config)#host fxhfxh(config)#定义路由器的名称为FXH,那么对路由器定义名称,是为了区别我们所操作所有设备的不同.为路由器添加特权密码 router(config)#enable password sss(sss为我们定义的明文密码) router(config)#enable secret cisco (cisco为我们定义的密文密码)启用控制台密码 router(config)#line console 0 router(config-line)#password xxx(xxx为我们定义的通过console端口进入路由器的密码) router(config-line)# login(启用密码)为telnet访问启用密码router(config)#line vty 0 4router(config-line)#passowrd xxx(xxx为我们定义的密码)router(config-line)#login 作用是为了登陆使用*如果执行telnet,必须设置enable密码和telnet密码才可以实现采用telnet登陆路由器。不执行DNS解析router(config)#no ip domain-lookup (这条命令的作用是:当我们在执行命令错误的时候,路由器会认为这条命令没有错误,它只是一个域名的形式,那么他会给你解析,这样,很浪费我们宝贵的时间,router#asdTranslating asd.domain server (55)(55)Translating asd.domain server (55)% Unknown command or computer name, or unable to find computer address这样输入命令后当你的输入在出现错误的时候,路由器会提示router(config)#no ip domain-lookuprouter(config)#Zrouter#asdf05:46:49: %SYS-5-CONFIG_I: Configured from console by consoleTranslating asdfTranslating asdf% Unknown command or computer name, or unable to find computer address)配置路由器,使得控制台端口不会中止你的连接。router(config-line)#exec-timeout 0 我们在长时间不去操作路由器的时候,我们的路由器会自动的终止与我们的对话连接,跳转到非连接状态,这时候,我们还需要输入enable密码重新登陆,从某种意义上来讲是对安全性得到了保证,但是对我们的操作是十分的不方便的。配置路由器,使得路由器发送的控制台屏幕的消息不会附加到命令行中 router(config)#line console 0 router(config-line)# logging synchronous配置路由器,使得当登陆控制台端口的时候显示一个标题。 router(config)#banner motd Enter TEXT message.End with the character m. 在这里M是我们结束时候输入的结束控制字符,你最好找一个特殊的作为结束,例如等等。Xxxxxxx(是我们定义的信息)为路由器的各种接口配置IP地址router(config )#interfaces0(进入接口)router(config-if)# ip address (为接口添加IP地址)router(config-if)#clock rate 64000(定义接口时钟频率,仅用于DCE)router(config-if)# no shut(启动端口)router(config-if)# interface e0router(config-if)# ip address router(config-if)# no shutrouter(config-if)# interface bri0 (进入ISDN的接口)router(config-if)# ip address router(config-if)# no shutrouter(config-if)# interface s0.1(进入子接口)router(config-if)# ip address router(config-if)# no shutrouter(config-if)#interface loopback 0(进入逻辑的环回接口)router(config-if)# ip address router(config-if)# no shut观察配置结果router#show run(察看路由器当前配置)version 12.1no service single-slot-reload-enableservice timestamps debug uptimeservice timestamps log uptimeno service password-encryptionhostname R2ip subnet-zero!interface Loopback0no ip addressinterface Ethernet0ip address !interface Serial0ip address shutdownclockrate 64000!interface Serial0.1ip address !interface Serial1no ip addressshutdown!ip classlessip http serverline con 0line aux 0line vty 0 4!endrouter#show ip int brief (察看路由器端口状态) Interface IP-Address OK? Method Status ProtlocolEthernet0 YES manual up upLoopback0 unassigned YES unsetup upSerial0 YES manual administratively down downSerial0.1 YES manual administratively down downSerial1 unassigned YES unsetadministratively down dow备份和升级IOS软件1:IOS备份首先安装tftpserver软件,这种软件在网络上到处都是,下载完成后,安装在你的机器上,这时候,你的PC就是一台tftp服务器了,然后进入路由器,这里需要主意的是,你的PC要与你的路由器的E0口保持连接状态,不管是直连还是通过交换网都可以。Router#sh flash:查看本路由ios名称是什么。System flash directory:FileLength Name/status1 8083776c2500-c-l.122-26.bin8083840 bytes used, 304764 available, 8388604 total8192K bytes of processor board System flash (Read ONLY)router#copy flash tftp 把flash中的信息拷贝到tftp中。Address or name of remote host ? 25(输入TFTP服务器地址)Source file name ?c2500-js-1.112-18.bin(输入源文件名称,这时候你可以通过查看过程中,把本机的flash名称copy下来,在这里粘贴就可以了。)Destination file name c2500-js-1.112-18.bin?回车就可以了2:IOS升级router#copy tftp flash基本与IOS的备份步骤相同,要求输入TFTP地址和源文件名称。一路回车就可以了。但是在这里需要主意的是:Router#sh flash:System flash directory:FileLength Name/status1 8083776c2500-c-l.122-26.bin8083840 bytes used, 304764 available, 8388604 total8192K bytes of processor board System flash (Read ONLY) 我们这里的flash信息是只读的,需要改变配置寄存器的值,使我们的flash保持可以读写状态。Router(config)#config-register 0x2101Router#wriRouter#reload 就可以完成了,然后在继续上面的升级工作才可以。管理配置文件1:配置更改的保存Router#copy running-config startup-config 把配置文件从内存中保存到nvram中。2:配置文件的更新Router#copy startup-config running-config 将nvram中保存的文件覆盖内存中的。3:配置文件的备份router#copy running-config tftp(将当前运行的配置保存到TFTP服务器)router#copy startup-config tftp(将NVRAM中的配置保存到TFTP服务器)前提和升级备份IOS的准备工作是一样的。4删除配置router#erase startup-config路由器的口令设置和口令恢复1:口令设置router(config)#line console 0router(config-line)#password Cisco(Cisco为我们添加的密码)router(config-line)#login(应用密码)router(config)#line vty 0 4router(config-line)#password Ciscorouter(config-line)#loginrouter(config)#line aux 0router(config-line)#password Ciscorouter(config-line)#loginrouter(config)#line 0 6设置async异步串行链路的密码router(config-line)#password Ciscorouter(config-line)#login2:简单的口令恢复所有口令恢复的原理是通过开启配置寄存器的第6位,绕过startup-config文件,即避开以前设置的密码,路由器重新启动以后将可以重新配置密码。这里只给出2500系列路由器的密码恢复方法。其他路由器的口令恢复,你会在下面的实验中看到。首先,在路由器启动的时候输入 Ctrl+Break组合键进入最小启动模式。Copyright (c) 1986-1994 by Cisco Systems 2500 processor with 14336 Kbytes of main memoryAbort at 0x103B35C (PC)oBit# Configuration register option settings:15 Diagnostic mode disabled14 IP broadcasts do not have network numbers13 Boot default ROM software if network boot fails12-11 Console speed is 9600 baud10 IP broadcasts with ones08 Break disabled07 OEM disabled06 Ignore configuration enabled03-00 Boot file is Cisco2-2500 (or boot system command)o/r 0x2142I路由器开始重起,然后可以正常的使用路由器了不过需要重新配置路由器,因为路由器的配置文件在启动时被忽略了。当我们重新配置好路由器保存配置以后,需要将0x2142模式改成0x2102模式,防止无意的修改。Route#config-regedit 0x2102然后重新启动路由器路由器的常用show命令的应用1:显示版本,寄存器模式等信息 router#show version Cisco Internetwork Operating System SoftwareIOS (tm) 2500 Software (C2500-I-L), Version 12.1(21), RELEASE SOFTWARE (fc1)Copyright (c) 1986-2003 by Cisco Systems, Inc.Compiled Tue 19-Aug-03 01:04 by kellythwImage text-base: 0x03041F90, data-base: 0x00001000ROM: System Bootstrap, Version 4.14(6)fc3, SOFTWARERouter uptime is 12 minutesSystem returned to ROM by reloadSystem image file is flash:c2500-i-l.121-21.binCisco 2500 (68030) processor (revision D) with 16384K/2048K bytes of memory.Processor board ID 02999009, with hardware revision 00000000Bridging software.X.25 software, Version Ethernet/IEEE 802.3 interface(s)2 Serial network interface(s)32K bytes of non-volatile configuration memory.8192K bytes of processor board System flash (Read ONLY)Configuration register is 0x21422:显示目前路由器的配置 router#show run Current configuration : 409 bytes!version 12.1no service single-slot-reload-enableservice timestamps debug uptimeservice timestamps log uptimeno service password-encryption!hostname Router!ip subnet-zero!interface Ethernet0no ip addressshutdown!interface Serial0no ip addressshutdown!interface Serial1no ip addressshutdown!ip classlessip http server!line con 0line aux 0line vty 0 4!end3:显示CPU使用率 router#show processes cpu 14 88 144 6110.00%0.00%0.00% 0 Net Background15 12 7 17140.00%0.00%0.00% 0 Logger16 88 761 1150.00%0.00%0.00% 0 TTY Background17 8 921 80.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年四川省西南医科大学选调笔试真题
- 2024年四川阿坝师范学院选调笔试真题
- 2024年厦门银行福建漳州分行招聘笔试真题
- 2024年莆田九十五医院招聘笔试真题
- 2024年马鞍山市福利院招聘笔试真题
- 2024年吉安县农业农村局招聘笔试真题
- 行业最佳实践分享与讨论计划
- 法学概论论文写作指导试题及答案
- 信息处理技术员考题及答案收录
- 2025届江苏省扬州市仪征市第三中学数学八下期末经典模拟试题含解析
- 选拔卷-:2024年小升初数学模拟卷三(北师大版)A3版
- 康复医学康复治疗技术含内容模板
- 无人机技术在农业的应用
- 快递云仓合同范本
- NB-T 47037-2021 电站阀门型号编制方法
- 2024春期国开电大专科《液压与气压传动》在线形考(形考任务+实验报告)试题及答案
- 2024年辅警考试公基常识300题(附解析)
- 前额叶皮质在记忆中的作用与机制
- 小学少先队活动课说课稿
- 妊娠期常见的皮肤病
- T∕CACM 1078-2018 中医治未病技术操作规范 拔罐
评论
0/150
提交评论