路由交换实验二——路由器密码恢复

原理

路由器的内部组件主要有主板、CPU、存贮系统和接口。

其中存贮系统包括:

在这里插入图片描述

正常启动顺序为123,3为非易失内存中的配置文件(包含密码),想要恢复密码需要先跳过配置文件,即启动顺序更改为12。

在这里插入图片描述

开始实验

重启路由

通过CONSOLE连接路由器,加电重启,10秒内按CTRL+BREAK,进入监控模式。

System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)
Copyright (c) 2000 by cisco Systems, Inc.
Initializing memory for ECC
..
c2811 processor with 524288 Kbytes of main memory
Main memory is configured to 64 bit mode with ECC enabled

Readonly ROMMON initialized

program load complete, entry point: 0x8000f000, size: 0xc940
program load complete, entry point: 0x8000f000, size: 0xc940

program load complete, entry point: 0x8000f000, size: 0x3ed1338
Self decompressing the image :
########################################
monitor: command "boot" aborted due to user interrupt
rommon 1 > 

修改寄存器的值

其中R2500系列输入命令为:

rommon 1 > o/r 0x2142

R2600系列及以上输入命令为:

rommon 1 > confreg 0x2142

寄存器的值是0x2102时为正常启动,值是0x2142为跳过配置文件启动。

重新启动

其中R2500系列输入命令为:

rommon 2 > i

R2600系列及以上输入命令为:

rommon 2 > reset

恢复密码

重启后进入特权模式,查看配置文件中的密码。

outer#show startup-config 
Using 868 bytes
!
... ...
!
line con 0
 password 123456
 login
!
... ...

如果为明文密码,记下后直接跳转到还原寄存器的值部分。

如果为密文密码,则先将配置文件读入内存中(如果不读入内存,后续覆盖配置文件时会丢失其他配置):

Router#copy startup-config running-config 

Destination filename [running-config]? 
868 bytes copied in 0.416 secs (2086 bytes/sec)
r1#
%SYS-5-CONFIG_I: Configured from console by console

再对需要恢复的密码进行重新设置:

详见路由交换实验一——CISCO路由器的基本配置的配置密码部分。

还原寄存器的值

在配置模式下输入:

r1(config)#config 0x2102

寄存器的值是0x2102时为正常启动,值是0x2142为跳过配置文件启动。

保存配置

在特权模式下输入:

r1#copy running-config startup-config 

Destination filename [startup-config]? 
Building configuration...
[OK]

或:

r1#write 

Building configuration...
[OK]

最后输入命令重新启动即可:

r1#reload 

Proceed with reload? [confirm]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值