作为一个网络管理员,路由器密码的安全性是一件非常重要的事情,但是如果一不小心忘记了那该怎么办呢?唯一的办法那就是对路由器的密码信息进行重置。
网络管理的交换机上一般都有一个“Console”端口[1],它是专门用于对交换机进行配置和管理的。通过Console端口连接并配置交换机,是配置和管理交换机必须经过的步骤。因为其他方式的配置往往需要借助于IP地址、域名或设备名称才可以实现,而新购买的交换机显然不可能内置有这些参数,所以Console端口是最常用、最基本的交换机管理和配置端口。
首先要准备一个console线用于连接路由器与控制电脑,只有在近距离的接触路由器而不是远程登录才能实现对其特权密码的重置,首先我们要了解路由器寄存器的相关概念。
Configuration Register Values and theirMeaning
If you know the value of your configuration register, you can determine itsmeaning. For information on the meaning of your configuration register setting,including potential issues and fixes, collect the output of the showversion command, or
the show tech-support command,and input into the Output Interpreter ( registered customers
only) tool. In order to use Output Interpreter (registered customers
only) , you must be a registered customer,be logged in, and have JavaScript enabled.
This table contains some common settings which are valid on most platforms.
Note: Check the appropriate hardware installation guide to verifythat the configuration register can be used before you change the configurationregister on your router to one of the values in this table.
Configuration Register Setting |
Router Behavior |
0x102 |
· Ignores break · 9600 console baud |
0x1202 |
· 1200 baud rate |
0x2101 |
· Boots into bootstrap · Ignores break · Boots into ROM if initial boot fails · 9600 console baud rate |
0x2102 |
· Ignores break · Boots into ROM if initial boot fails · 9600 console baud rate default value for most platforms |
0x2120 |
· Boots into ROMmon · 19200 console speed |
0x2122 |
· Ignores break · Boots into ROM if initial boot fails · 19200 console baud rate |
0x2124 |
· NetBoot · Ignores break · Boots into ROM if initial boot fails · 19200 console speed |
0x2142 |
· Ignores break · Boots into ROM if initial boot fails · 9600 console baud rate · Ignores the contents of Non-Volatile RAM (NVRAM) (ignores configuration) |
0x2902 |
· Ignores break · Boots into ROM if initial boot fails · 4800 console baud rate |
0x2922 |
· Ignores break · Boots into ROM if initial boot fails · 38400 console baud rate |
0x3122 |
· Ignores break · Boots into ROM if initial boot fails · 57600 console baud rate |
0x3902 |
· Ignores break · Boots into ROM if initial boot fails · 2400 console baud rate |
0x3922 |
· Ignores break · Boots into ROM if initial boot fails · 115200 console baud rate |
总之就是要记住这样几个常用的:
0x2102 :标准默认值
0x2142 :从FLASH中启动,但不使用NVRAM中的配置文件(用于口令恢复)
0x2101 :从Boot RAM中启动,应用于更新系统文件
0x2141 :从Boot RAM中启动,但不使用NVRAM中的配置文件
对于重围路由器密码,具体的步骤如下:
//故意设定复杂密码进行模拟实验
Router>en
Router#configure terminal
Enter configuration commands, one perline. End with CNTL/Z.
Router(config)#enable secret 1234qwer
//输入三次无效密码则退出
Router>en
Password:
Password:
Password:
% Bad secrets
//关闭路由器实际电源按钮并重启并在60秒内按住Ctrl+Break键进入选项
Self decompressing the image :
##############################
monitor: command "boot" aborteddue to user interrupt
//从FLASH中启动,但不使用NVRAM中的配置文件(用于口令恢复)
rommon 1 > confreg 0x2142
rommon 2 > reset //即可实现计算机重新启动
//直接进入特权模式,没有密码限制
Router>en
Router#configure terminal
Enter configuration commands, one perline. End with CNTL/Z.
Router(config)#config-register 0x2102 //恢复默认的启动状态
Router(config)#enable secret 123 //设置新的密码
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console byconsole
//将现在运行的配置文件保存到启动文件当中,使对密码的更改下次启动有效
Router#copy running-configstartup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Router#reboot
重新启动后经过实验即可发现已经实现了对密码的重置,在现实系统运维中,保持路由器的正常工作了密码的安全是相当重要的,因此路由器交换机等设备应该保管在安全的位置。
原文:http://blog.csdn.net/xhrrongshuai/article/details/20861607