一.针对无mode按钮型号设备
1.进入rommon界面
键盘ctrl+break
2.修改寄存器值
rommon>confreg 0x2142
rommon>reset
3.进入系统,修改密码
Router(config)#enable secret cisco
4.还原寄存器值
Router(config)#config-register 0x2102
Router(config)#copy running-config startup-config
5.重启
Router(config)#reload
二.针对有mode按钮型号设备
1.设备下电,按住mode按钮,重新上电,等待出现类似如下界面
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>
2.初始化flash文件系统
switch>flash_init
3.加载帮助文件
switch>load_helper
4.显示flash内容
switch>dir flash:
5.重命名配置文件
switch>rename flash:config.text flash:config.text.old
6.启动系统,并且如果提示进入setup模式,输入N:
switch>boot
Continue with the configuration dialog? [yes/no]: N
7.进入特权模式,把配置文件名恢复为原始文件名
Switch#rename flash:config.text.old flash:config.text
8.把配置文件写进内存
Switch#copy flash:config.text system:running-config
Source filename [config.text]?
Destination filename [running-config]?
9.进入全局配置模式更改密码
Switch(config)#enable secert {password}
10.退出保存配置到startup-config文件
Switch(config)#copy running-config startup-config