亩态
思科设备配置新手篇--密码恢复方法大全(下)
发布时间:2018-11-23 浏览次数:3742

7 Cisco系列路由器进入rom状态的几种方法 
对于Cisco的各种路由器进入rom状态的方法不尽相同,但一般通过如下3种方法可以进入rom状态,在使用过程中可以分别试用。 
(1)如果Break未被屏蔽,可以在开机60 s内按Ctrl+Break键中断启动过程,进入rom状态。 
(2)如果Break键已经屏蔽,可以通过循环开机的方法进入rom状态,方法是:路由器开机后,将电源关闭,间隔5 s后重新开机,一般会进入rom状态。此方法适用于7500、12000等路由器。 
(3)将超级终端通信波特率设置为1200,数据位8,奇偶位1,停止位无。开启路由器电源,启动后关机,5 s后重新开机,同时一直按住空格键12 s后放开,等路由器启动完成后,重新更改超级终端位默认值,通信波特率设置为9600,数据位8,奇偶位1,停止位1。重新连接后,从终端上可以看到已经进入rom状态。注意:在波特率为1200时,终端上没有内容显示。此方法适用于2500、2600、4500等系列路由器。

  1.对于Catalyst 2900/3500XL系列来说:

  拔下交换机的电源线,然后按住交换机的Mode按钮,再重新插上交换机的电源线.直到端口Port 1x的LED熄灭之后释放Mode按钮。  

  2.对于Catalyst 2940/2950L系列来说:

  拔下交换机的电源线,然后按住交换机的Mode按钮,再重新插上交换机的电源线.直到STAT的LED熄灭之后释放Mode按钮。

  3.对于Catalyst 2955系列来说:

  Catalyst 2955没有没有外部的Mode按钮,因此就不能使用之前的那种方法来进行密码恢复.在交换机启动时,对于Windows系列的PC,按下Ctrl+Break键;对于UNIX系列的工作站,按下Ctrl+C.如下:

以下是引用片段:
  C2955 Boot Loader (C2955−HBOOT−M) Version 12.1(0.0.514), CISCO DEVELOPMENT TEST 
  VERSION 
  Compiled Fri 13−Dec−02 17:38 by madison 
  WS−C2955T−12 starting... 
  Base ethernet MAC Address: 00:0b:be:b6:ee:00 
  Xmodem file system is available. 
  Initializing Flash... 
  flashfs[0]: 19 files, 2 directories 
  flashfs[0]: 0 orphaned files, 0 orphaned directories 
  flashfs[0]: Total bytes: 7741440 
  flashfs[0]: Bytes used: 4510720 
  flashfs[0]: Bytes available: 3230720 
  flashfs[0]: flashfs fsck took 7 seconds. 
  ...done initializing flash. 
  Boot Sector Filesystem (bs:) installed, fsid: 3 
  Parameter Block Filesystem (pb:) installed, fsid: 4 
  /---接下来交换机会在15秒内自动启动,等出现该信息之后,按下Ctrl+Break键或Ctrl+C键----/ 
  The system has been interrupted prior to initializing the flash file system to finish 
  loading the operating system software: 
  flash_init 
  load_helper 
  bootswitch:   接下来输入flash_init命令:

以下是引用片段:
  switch:flash_init 
  Initializing Flash... 
  flashfs[0]: 143 files, 4 directories 
  flashfs[0]: 0 orphaned files, 0 orphaned directories 
  flashfs[0]: Total bytes: 3612672 
  flashfs[0]: Bytes used: 2729472 
  flashfs[0]: Bytes available: 883200 
  flashfs[0]: flashfs fsck took 86 seconds 
  ....done Initializing Flash. 
  Boot Sector Filesystem (bs:) installed, fsid: 3 
  Parameter Block Filesystem (pb:) installed, fsid: 4 
  switch:   接着输入load_helper命令:

以下是引用片段:
  switch:load_helper 
  switch:   再输入dir flash:命令显示交换机的文件系统:

以下是引用片段:
  switch:dir flash: 
  Directory of flash:/ 
  2 −rwx 1803357 c3500xl−c3h2s−mz.120−5.WC7.bin 
  4 −rwx 1131 config.text 
  5 −rwx 109 info 
  6 −rwx 389 env_vars 
  7 drwx 640 html 
  18 −rwx 109 info.ver 
  403968 bytes available (3208704 bytes used) 
  switch:   把配置文件重命名:

以下是引用片段:
  switch:rename flash:config.text flash:config.old 
  switch:   输入boot命令启动交换机:

以下是引用片段:
  switch:boot 
  Loading "flash:c3500xl−c3h2s−mz.120−5.WC7.bin"...############################### ###################################################################### 
  File "flash:c3500xl−c3h2s−mz.120−5.WC7.bin" uncompressed and installed, entry po 
  int: 0x3000 
  executing... 
  (略)   不进入setup模式:

以下是引用片段:
  −−− System Configuration Dialog −−− 
  At any point you may enter a question mark '?' for help. 
  Use ctrl−c to abort configuration dialog at any prompt. 
  Default settings are in square brackets '[]'. 
  Continue with configuration dialog? [yes/no]: n   进入特权模式,恢复原始的配置文件:

以下是引用片段:
  Switch#rename flash:config.old flash:config.text 
  Destination filename [config.text] 
  Switch#   把配置文件保存在内存里:

以下是引用片段:
  Switch#copy flash:config.text system:running−config 
  Destination filename [running−config]? 
  1131 bytes copied in 0.760 secs 
  Switch#   进入全局配置模式,取消密码设置:

  Switch(config)#no enable secret

  保存配置:

以下是引用片段:
  Switch#write memory 
  Building configuration... 
  [OK] 
  Switch#

  4.对于Catalyst 3550/3750系列来说:

  1.通过带有支持Xmodem协议的超级终端程序的PC连接到交换机的console口,把波特率设置为9600。

  2.拔掉交换机的电源。

  3.按下交换机上的Mode按钮,与此同时,重新插上交换机的电源线.当交换机端口1X上的LED熄灭后可以松开Mode按钮1到2秒.之后将显示一些指示信息:

以下是引用片段:
  The system has been interrupted prior to initializing the flash file system. The following 
  commands will initialize the flash file system, and finish loading the operating system 
  software: 
  flash_init 
  load_helper 
  boot 
  switch#   4.初始化flash文件系统:

  switch#flash_init

  5.加载帮助文件:

  switch#load_helper

  6.显示闪存里的内容:

  switch#dir flash:

  7.重命名配置文件:

  switch#rename flash:config.text flash:config.text.old

  8.启动系统,并且如果提示进入setup模式,输入N:

以下是引用片段:
  switch#boot 
  Continue with the configuration dialog? [yes/no]: N   9.进入特权模式,把配置文件名恢复为原始文件名:

  Switch#rename flash:config.text.old flash:config.text

  10.把配置文件写进内存:

以下是引用片段:
  Switch#copy flash:config.text system:running-config 
  Source filename [config.text]? 
  Destination filename [running-config]?

  11.进入全局配置模式更改密码:

  Switch(config)#enable secret {password}

  12.退出,并保存到startup-config文件里:

  Switch(config)#copy running-config startup-config

  其实有的时候硬件安全比软件安全还要重要些。

 本文主要讲述Cisco 4506交换机密码恢复过程。

  (1) 交换机开机,30秒内按Ctrl+Break键,出现提示符“rommon 1 >"(如果没有出现该提示符,交换机重新开机,重复(1)步骤)。

  (2) 键入如下命令: rommon 1 > confreg 0x2142

  (3) 初始化交换机: " rommon 2 >reset"

  (4) switch#show startup-config

  这时将全部的内容备份

  (5)

以下是引用片段:
  switch#config mem 
  switch(config)#no enable secret 
  switch(config)#enable secret cisco 
  switch(config)#config-reg 0x2102" ; 
  "switch(config)#exit”; 
  switch#write mem   

(6) 重新启动交换机,即可:“switch#reload"。

  近日,由于一台交换机的OS比较老了,所以想更新一下,问人要了一个OS后就更新了,更新好后才发现出了问题,给我的OS是有密码的,由于这个密码他们正在使用,也不好问他们要,所以就准备清除密码了,在www.cisco.com上找到了相关的文章后,成功清除。特把清除过程写下来。

  先说一下配置环境吧,交换机是WS-C6509,用的是CatOS,在我看来,恢复Cisco密码的过程中恢复CatOS是最简单的,只要几步就可以完成了。

  1. 先把电脑或终端连到交换机的控制台上,启动交换机。

  2. 在交换机启动时,按下Enter键可以得到用户提示符,按Enter的时间如下:

  打开交换机后,一般都会出现如下的提示:

以下是引用片段:
  System Bootstrap, Version 5.3(1) 
  Copyright (c) 1994-1999 by Cisco Systems, Inc. 
  c6k_sup1 processor with 65536 Kbytes of main memory 
  Autoboot executing command: "boot bootflash:cat6000-sup9k.6-1-1c.bin" 
  Uncompressing file: ##################################################### 
  System Power On Diagnostics 
  DRAM Size ....................64 MB 
  Testing DRAM..................Passed 
  Verifying Text segment .......Passed 
  NVRAM Size ...................512 KB 
  Saving NVRAM .................Done 
  Testing NVRAM ................Passed 
  Restoring NVRAM ..............Done 
  Level2 Cache .................Present 
  Testing Level2 Cache .........Passed 
  System Power On Diagnostics Complete 
  Boot image: bootflash:cat6000-sup9k.6.1.1(c).bin   

当出现这一行的时候,交换机会正在加载OS,会静止两到三分钟,在这里你就可以作好准备,当一有新的内容出现的时候,就一直按Enter键,会看到出现如下的提示:

以下是引用片段:
  Running System Diagnostics from this Supervisor (Module 1) 
  This may take up to 2 minutes....please wait 
  Cisco Systems Console 
  Enter password:   这时候你就成功啦,直接按Enter键进入,交换机直接进入 Console> 提示符下

  3. 在等到用户提示符之后,输入enable进入特权模式。

  Console> en <------回车

  Enter password: <------也是直接按回车

  Console> (enable)

  4. 在特权模式下,就可以用set password 和 set enablepass两个命令来修改密码了。

以下是引用片段:
  Console> (enable) set password 
  Enter old password: <------按回车 
  Enter new password: <------按回车 
  Retype new password: <------按回车 
  Password changed. 
  Console> (enable) set enablepass 
  Enter old password: <------按回车 
  Enter new password: <------按回车 
  Retype new password: <------按回车 
  Password changed.   这样,就大功告成了,重启以后,你就会发现,密码被你给清空了。

  在这里,要提醒的一点是:上面的这一段时间是很有限的,大概只能三分钟左右的时间,所以动作可要快啊。


8 结束语 
作为3层设备,路由器是一种技术含量很高的网络设备,涉及到各种协议,技术面较广。熟练运用各种路由器,及时处理各种突发故障,对维护网路的正常运转有着重要意义。本文仅就Cisco各系列路由器中的典型型号的密码恢复方法进行介绍,但对于解决Cisco各系列路由器的类似问题,其具体操作也类似

思朋简介
联系我们
官方微博
思朋特色
服务宗旨
企业服务
商务合作
企业运维

Copyright 2023 江苏思朋信息科技有限公司 版权所有 技术支持:星度网络 苏ICP备2021003433号-2

地址:苏州市吴中区石湖西路188号万达广场西楼(苏州大学国家大学科技园吴中分园)19楼1902室(吴中万达1号门附近) 咨询热线:0512-80682876