1、这里可以看到小编使用的路由器
2、先做一下简单的配置Router#conf t更改路纛独编竿由器名称Router(config)#hostna罪焐芡拂me R1关闭日志和超时R1(config)#no ip domain-loR1(config)#line con 0R1(config-line)#logg synR1(config-line)#execR1(config-line)#exec-timeout 0 0配置接口IP地址,并且打开。R1(config-line)#int fa0/0R1(config-if)#ip add 192.168.1.1 255.255.255.0R1(config-if)#no shut设置加密密码R1(config)#enable secret dafgk
3、保存并且重新载入R1#wrBuilding configuration...[OK]R1#reload
4、在重新载入的时候,我们需要按住Ctrl+C键或者Ctrl+Break键。进入monitor模式下。
5、查看可以执行的命令,这里我们需要知道2142 这个寄存器值,它的意思是我们进入系统后不加载配置。2102这个寄存器值代表每次进入系统都要加载配置文件。
6、修改寄存器值,并且重置rommon 2 > confreg 0x2142rommon 3 > reset
7、可以看到一个纯净的IOS系统
8、将配置文件拷贝到当前Router>enableRouter# copy 衡痕贤伎startup-config running-config
9、查看配置R1# sh run
10、删除加密密码R1#conf tR1(config)#no enable secret
11、修改正常寄存器值为0x2102,并且保存。R1(config)#config-register 0x2102R1(config)#endR1#wr
12、重新启动Router#reload
13、启动后进入特权模式,可以看到没有要求密码。这样我们就完成了路由器的密码恢复!