网络通信 频道

CISCO路由器与交换机口令回复步骤

  交换机口令恢复的步骤
  ⒈连接交换机的console口到终端或PC仿真终端。用无Modem的直连线连接PC的串行口到交换机的console口。
  
  ⒉先按住交换机面板上的mode键,然后打开电源。
  
  ⒊初始化flash。
  
  >flash_init
  
  ⒋更名含有password的配置文件。
  
  >rename flash:config.text flash:config.old
  
  ⒌启动交换机。
  
  >boot
  
  ⒍进入特权模式。
  
  >enable
  
  ⒎此时开机是已忽略password。
  
  #rename flash:config.old flash:config.text
  
  ⒏copy配置文件到当前系统中。
  
  #copy flash:config.text system:running-config
  
  ⒐修改口令。
  
  #configure terminal
  
  #enable secret
  
  ⒑保存配置。
  
  #write
  
  路由器口令恢复步骤
  ⒈连接路由器的console口到终端或PC仿真终端。用无Modem的直连线连接PC的串行口到路由器的console口。
  
  ⒉用show version命令显示并记录配置寄存器的值,通常为0x2102或0x102.如果用show version命令不能获得有关提示,可以查看类似的路由器来获得配置寄存器的值或用0x2102试试。
  
  ⒊关闭路由器的电源,然后再打开。
  
  ⒋在启动的前60秒内按Break键,你将会看到“〉”提示符(无路由器名),如果没有看到“〉”提示符,说明你没有正确发出Break信号,这时可检查终端或仿真终端的设置。
  
  ⒌在“〉”提示符下键入 o/r 0x42从Flash memory中引导或键入o/r 0x41从ROM中引导(注意:这里“o”是小写字母“O”)。如果它有Flash且原封没动过,0x42是最好的设置,因为它是缺省值,仅当Flash被擦除或没有安装时使用0x41。如果用0x41,你可以查看或删除原配置,但你不能改变口令。
  
  ⒍在“〉”提示符下键入i,路由器将重新启动而忽略它保存的配置。
  
  ⒎在设置中的所有问题都回答“no”。
  
  ⒏在Router〉提示符下键入enable,你将进入特权用户Router#提示。
  
  ⒐查看口令,键入 show config 改变口令(在口令加密情况下),按照如下的步骤进行:
  
  (a)键入config mem拷贝NVRAM到memory中;
  
  (b)键入wr term;
  
  (c)如果你作过enable secret xxxx, 执行下列命令:键入config term然后键入enable secret按Ctrl+Z;如果你没有作过enable secret xxxx,则键入enable password,Press Ctrl+Z;
  
  (d)键入write mem提交保存改变;若删除配置,键入write erase。
  
  ⒑在Router#提示符下键入config term。
  
  ⒒键入config-register0x2102,或键入在第二步记录的值。
  
  ⒓按 Ctrl+Z退出编辑。
  
  ⒔在Router#提示符下键入reload命令,不需要做write memory。 
  
  Cisco路由器IOS映像恢复及升级方法
  由于历史原因,Cisco公司的路由器产品丰富且繁杂,Cisco路由器的专用操作系统IOS映像也同时存在多个版本,以下就分别针对两类加载不同版本的IOS映像文件的Cisco路由器做讨论。
  
  一、Cisco 1000,1600,2500,4000系列
  1、IOS映像恢复的方法及步骤
  1) 连接PC的COM1口与路由器的console口,使用PC的超级终端软件访问该路由器;
  2) 开启路由器的电源开关,并在30秒内按下键盘的Ctrl+break,中断路由器的正常启动以进入rom监视模式,屏幕上提示符如下:
  >
  3) 键入如下命令:
  >o /r 0x2101 改变路由器虚拟寄存器的默认值(0x2102);
  4) 键入重启命令:
  >i
  路由器重启,当屏幕显示以下信息表明路由器重启完毕:
  System Bootstrap, Version 5.2(8a), RELEASE SOFTWARE
  Copyright (c) 1986-1995 by cisco Systems
  2500 processor with 1024 Kbytes of main memory
  …
  Press RETURN to get started!
  5) 路由器在虚拟寄存器的值为0x2101时自动进入rom启动模式:
  router(boot)>
  6) 此时,将TFTP服务器上的IOS映像文件恢复至路由器flash memory中,依次键入以下命令:
  router(boot)>en
  router(boot)#copy tftp flash
  System flash directory:
  No files in System flash
  [0 bytes used, 4194304 available, 4194304 total]
  Address or name of remote host [255.255.255.255]?192.168.18.168(IP地址已作技术处理,下同)
  Source file name? igs-i-l.110-22a.bin(IOS映像文件名)
  Destination file name [igs-i-l.110-22a.bin]?
  Accessing file ''igs-i-l.110-22a.bin'' on 192.168.18.168...
  Loading igs-i-l.110-22a.bin from 192.168.18.168 (via Ethernet0): ! [OK]
  Device needs erasure before copying new file
  Erase flash device before writing? [confirm]
  Copy ''igs-i-l.110-22a.bin'' from server
  as ''igs-i-l.110-22a.bin'' into Flash WITH erase? [yes/no]y
  Erasing device... eeeeeeeeeeeeeeee ...erased
  Loading igs-i-l.110-22a.bin from 192.168.18.168 (via Ethernet0): !!!!!!!!!!!!!!!!!!!!(!表示恢复成功)
  7) 还原路由器虚拟寄存器的默认值(0x2102),恢复路由器的正常启动顺序,依次键入以下命令:
  router(boot)#conf t
  router(boot)(config)#config-register 0x2102
  router(boot)(config)#exit
  router(boot)#wr
  router(boot)#reload
  2、IOS映像升级的方法及步骤
  1) 升级之前先备份,将相关文件备份至TFTP服务器,键入如下命令:
  router#copy bootflash tftp(Cisco 2500系列路由器不存在bootflash,相应的是rom)
  router#copy flash tftp
  router#copy startup-config tftp
  2) 因为Cisco 1000,1600,2500,4000系列路由器不允许在正常工作状态下重写flash memory,所以只有进入rom(或bootflash)启动模式才能升级IOS映像,依次键入以下命令:
  router#conf t
  router(config)#config-register 0x2101
  router(config)#exit
  router#wr
  router#reload
  3) 路由器重启完毕后进入rom(或bootflash)启动模式,从TFTP服务器将新的IOS映像文件拷贝至路由器的flash memory中:
  router(boot)#copy tftp flash
  4) 还原路由器虚拟寄存器的默认值(0x2102),恢复路由器的正常启动顺序,依次键入以下命令:
  router(boot)#conf t
  router(boot)(config)#config-register 0x2102
  router(boot)(config)#exit
  router(boot)#wr
  router(boot)#reload
  
  二、Cisco 1700,2600,3600,7200系列
  1、IOS映像恢复的方法及步骤
  1) 连接PC的COM1口与路由器的console口,使用PC的超级终端软件访问该路由器;
  2) 开启路由器的电源开关,并在30秒内按下键盘的Ctrl+break,中断路由器的正常启动以进入rom监视模式,屏幕上提示符如下:
  rommon 1>
  3) 键入xmodem命令:
  rommon 1>xmodem c3640-i-mz.120-10.bin(IOS映像文件名)
  4) 然后,路由器一直等待从PC上接收该IOS映像文件,此时在超级终端软件中点击发送选项,选择存放在PC本地硬盘中的IOS映像文件,确定后即开始下载文件至路由器的flash memory中,由于通讯带宽只有9600波特,整个文件下载时间约为1.5小时(依文件大小而定),屏幕显示信息如下:
  Do not start the sending program yet...
  device does not contain a valid magic number
  dir: cannot open device flash:
  WARNING: All existing data in flash will be lost!
  Invoke this application only for disaster recovery.
  Do you wish to continue? y/n[n]:y
  Ready to receive file c3640-i-mz.120-10.bin ...
  Erasing flash at 0x307c0000
  program flash location 0x30380000
  Download Complete!
  program load complete, entry point: 0x80008000, size: 0x38f410
  5) 接着,路由器将自动重启,屏幕显示信息如下:
  Self decompressing the image : ################################# [OK]
  …
  Press RETURN to get started!
  2、IOS映像升级的方法及步骤
  1) 同理,升级之前先备份,将关键文件备份至TFTP服务器,键入下列命令: router#copy bootflash tftp(Cisco 3600系列路由器不存在bootflash)
  router#copy flash tftp
  router#copy startup-config tftp
  2) 因为Cisco 1700,2600,3600,7200系列路由器允许在正常工作状态下重写flash memory,所以直接键入以下命令就可完成IOS映像的在线升级:
  router#copy tftp flash
  router#reload
  或者,为保险起见(以路由器停止服务为代价),在进入rom监视模式后才进行IOS映像的升级,则依次进行下列操作:
  2) 在路由器重启加电后30秒内按下键盘的Ctrl+break,中断路由器的正常启动直接进入rom监视模式,屏幕上提示符如下:
  rommon 1>
  或者,在路由器重启过程完成后进行以下操作,同样可以进入路由器的rom监视模式:
  router#conf t <

文章转载地址:http://cisco.chinaitlab.com/base/21827.html

0
相关文章