作為一個網路系統管理員,路由器密碼的安全性是一件非常重要的事情,但是如果一不小心忘記了那該怎麼辦呢?唯一的辦法那就是對路由器的密碼資訊進行重設。
網路管理的交換器上一般都有一個“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
重新啟動後經過實驗即可發現已經實現了對密碼的重設,在現實系統營運中,保持路由器的正常工作了密碼的安全是相當重要的,因此路由器交換器等裝置應該保管在安全的位置。