交换机密码恢复主要原理就是在交换机启动时,不让它去读取nvram中的配置文件,从而跳过读取密码的步骤
1、拔掉交换机电源,手按Mode按钮,插入电源,待第一个灯正常显示后,手松开Mode按钮
2、修改到nvram中的startup_config文件
switch: flash_init (初始化flash文件系统)
switch: load_helper (装载并初始化辅助映像ROM中的最小IOS映像)
switch: dir flash: (显示flash文件内的文件和目录)
switch: rename flash:config.text flash:config.old (修改配置文件名,以便跳过密码)
switch: boot (重启)
3、将配置导入内存正常运行
Swith#rename flash:config.old flash:config.text
Switch#copy startup-config running-config
4、重新配置新的密码即可!
4500以上系列交换机密码恢复 :
1、拔掉电源,按crtl+c,直到出现rommon<模式
2.、输入confreg
=> load ROM after netboot fails
=> console baud:
=> autoboot from: commands specified in 'BOOT' environment variable
do you wish to change the configuration? y/n [n]: y (重要)
enable "diagnostic mode"? y/n [n]: n
enable "use net in IP bcast address"? y/n [n]: n
disable "load ROM after netboot fails"? y/n [n]: n
enable "use all zero broadcast"? y/n [n]: n
enable "break/abort has effect"? y/n [n]: n
enable "ignore system config info"? y/n [n]: y (重要)
change console baud rate? y/n [n]: n
change the boot characteristics? y/n [n]: n
Configuration Summary :
=> load ROM after netboot fails
=> ignore system config info
=> console baud: 9600
=> autoboot from: commands specified in 'BOOT' environment variable
do you wish to save this configuration? y/n [n]: y (重要)
You must reset or power cycle for new configuration to take effect
rommon 2 > reset (最后重启)
3、此时交换机是从CF卡中引导启动的,修改交换机从flash引导
Switch(config)#boot system bootflash:
4、最后保存修改信息
Switch#write