三步搞定! 1:重啟路由器設(shè)備,在出現(xiàn)很多“#”號(hào)的時(shí)候按crtl+break 2:輸入confreg 0x2142 3:輸入reset 這樣你就可以繞過(guò)配置文件進(jìn)去路由器了 下面就是重新設(shè)置一下密碼了,然后在全局模式下把配置寄存器的值改為0X2102,然后保存一下,重啟就可以了,你以前的配置除了密碼修改了一下外,其他的都沒(méi)變! 全局模式下配置寄存器的修改:Configuration register 0x2102 ************** 在重新載入的時(shí)候,我們需要按住Ctrl+C鍵或者Ctrl+Break鍵。進(jìn)入monitor模式下。 
查看可以執(zhí)行的命令,這里我們需要知道2142 這個(gè)寄存器值,它的意思是我們進(jìn)入系統(tǒng)后不加載配置。2102這個(gè)寄存器值代表每次進(jìn)入系統(tǒng)都要加載配置文件。 
請(qǐng)點(diǎn)擊輸入圖片描述 修改寄存器值,并且重置 rommon 2 > confreg 0x2142 rommon 3 > reset 
請(qǐng)點(diǎn)擊輸入圖片描述 可以看到一個(gè)純凈的IOS系統(tǒng) 
請(qǐng)點(diǎn)擊輸入圖片描述 將配置文件拷貝到當(dāng)前 Router>enable Router# copy startup-config running-config 
請(qǐng)點(diǎn)擊輸入圖片描述 查看配置 R1# sh run 
請(qǐng)點(diǎn)擊輸入圖片描述 刪除加密密碼 R1#conf t R1(config)#no enable secret 修改正常寄存器值為0x2102,并且保存。 R1(config)#config-register 0x2102 R1(config)#end R1#wr 
請(qǐng)點(diǎn)擊輸入圖片描述 重新啟動(dòng) Router#reload 
請(qǐng)點(diǎn)擊輸入圖片描述 啟動(dòng)后進(jìn)入特權(quán)模式,可以看到?jīng)]有要求密碼。這樣我們就完成了路由器的密碼恢復(fù)! 
**********************
路由器忘記密碼是很常見(jiàn)也是很麻煩的事情,這個(gè)時(shí)候就需要我們恢復(fù)下密碼?;謴?fù)密碼的主要步驟是: 1.中斷路由器啟動(dòng) ctrl+break鍵 2.更改配置寄存器的值為0x2142 3.重啟路由器 4.查看保存的配置文件中enable密碼 5.重設(shè)enable密碼 6.保存配置 7.更改配置寄存器的值為0x2102 實(shí)際配置: 關(guān)閉路由器,重啟: Self decompressing the p_w_picpath : 啟動(dòng)路由器時(shí)按ctrl+Break鍵 ########################## monitor: command "boot" aborted due to user interrupt rommon 1 > confreg 0x2142 配置配置寄存器的值為0x2142 rommon 2 > reset 重啟路由器 Continue with configuration dialog? [yes/no]: n 不再加載startup-config Router#show startup-config 查看以前的密碼 Router#copy startup-config running-config 將以前的配置加載到內(nèi)存 Router#config t進(jìn)入全局配置模式 Router(config)#enable password cisco 將密碼重置 Router(config)# Router#copy running-config startup-config 將更改完密碼的配置保存 Destination filename [startup-config]? Building configuration... [OK] Router#Router#show version 查看配置寄存器的值 Configuration register is 0x2142 Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#conf t
Router(config)#config-register 0x2102 重新配置寄存器值 附:寄存器值意義 0x2102:運(yùn)行過(guò)程中中斷鍵被屏蔽,路由器會(huì)查看NVRAM中配置的內(nèi)容以確定啟動(dòng)次序,如果啟動(dòng)失敗會(huì)采用缺省的ROM軟件進(jìn)行啟動(dòng)。 0x2142:恢復(fù)密碼時(shí)候使用。忽略NVRAM配置信息而進(jìn)入初始配置對(duì)話模式中去。 路由器啟動(dòng)過(guò)程:
一、路由器加電后,首先運(yùn)行ROM中的POST程序(Power On Self Test)對(duì)路由器的硬件進(jìn)行檢測(cè),俗稱加電自檢。 二、檢測(cè)通過(guò)后緊接著執(zhí)行ROM中的引導(dǎo)程序(bootstrap),并根據(jù)寄存器值(register)來(lái)決定啟動(dòng)方式。 寄存器值的格式為:0x21YZ Y列的狀態(tài):0x210Z 從nvram加載配置文件 0x214Z 不從nvram加載配置文件 Z列的狀態(tài):0x21Y0 從rommon啟動(dòng) 提示符為:> (路由器啟動(dòng)時(shí)按Ctrl+Break) 0x21Y1 從mini ios啟動(dòng) 提示符為:Router(boot)> 0x21Y2 從flash 啟動(dòng) 提示符為:Router> 我們經(jīng)常使用的兩個(gè)寄存器值:0x2102 (正常),0x2142(不讀取保存的配置)。 三、如果正常啟動(dòng),則按引導(dǎo)程序到Flash中查找IOS鏡像。如果找到IOS鏡像,則讀取后正常啟動(dòng)。如果沒(méi)有找到IOS鏡像,則進(jìn)入boot模式,即Mini IOS啟動(dòng)。boot模式下可使用TFTP上的IOS;或使用TFTP/X-modem為路由器重新灌一個(gè)IOS。如果Mini IOS也啟動(dòng)失敗,則進(jìn)入rom monitor模式。 四、讀取IOS并初始化成功后,引導(dǎo)程序?qū)⒏呒拇嫫髦禌Q定加載或者不加載啟動(dòng)配置文件。如果選擇加載,則到NVRAM中找到啟動(dòng)配置文件,并加載到 RAM中成為運(yùn)行配置文件。如果選擇不加載或者根本沒(méi)有啟動(dòng)配置文件,則路由器會(huì)進(jìn)入詢問(wèn)配置模式,以問(wèn)答的方式對(duì)路由器進(jìn)行基本配置。 五、進(jìn)入用戶模式,啟動(dòng)過(guò)程完畢。 **********************************
思科路由器密碼恢復(fù)方法一 使用這種方法可使下列思科路由器密碼恢復(fù):Cisco2000系列、2500系列、3000系列、使用680x0MotorolaCPU的Cisco4000系列、運(yùn)行10.0版本以上CiscoIOS系統(tǒng)的7000系列路由器。 1.在路由器的console口接上一個(gè)終端或用安裝仿真終端軟件的PC機(jī)。 2.輸入showversion命令,然后記下寄存器值,通常是0x2102or0x102。這個(gè)值顯示在***一行,注意寄存器的配置是否把Break設(shè)為enable或disable。 缺省配置寄存器值是0x2102。這個(gè)值從左數(shù)第三個(gè)數(shù)字如果是1,則是disableBreak;如果為零,則Break為enabled。 3.切斷電源后再重啟。 4.在路由器啟動(dòng)的60秒內(nèi)在終端機(jī)上按Break鍵。將顯示rommon>提示符。如果提示符不是這樣,則終端沒(méi)有發(fā)出正確的中斷信號(hào),檢查Break鍵是否正確或是否被設(shè)為disable。 5.在提示符下輸入o/r0x42或o/r0x41,o/r0x42意思是從Flashmemory引導(dǎo),o/r0x41意思是從ROMs引導(dǎo)(注意,***個(gè)字符是字母o,不是數(shù)字0)。***用0x42,在Flashmemory沒(méi)有裝或erase的情況下,才用0x41,如果有0x41則只能view或erase配置,不能直接更改密碼。 6.在rommon>提示符下輸入初始化命令。 7.輸入系統(tǒng)配置對(duì)話提示符敲no,一直等提示信息顯示:PressRETURNtogetstarted! 8.敲回車,出現(xiàn)Router>提示符。 9.輸入enable命令,出現(xiàn)Router#提示符。 10.選擇下面選項(xiàng)中的一項(xiàng): 如果password沒(méi)有加密,直接用morenvram:startup-config命令可以看密碼;在password加密的情況下,無(wú)法看,只能修改,輸入命令如下: Router#configurememory Router#configureterminal Router(config)#enablesecret1234abcd Router(config)#ctrl-z Router#writememory
11.在EXEC提示符輸入configureterminal進(jìn)入配置模式。輸入config-register命令,把在第二步中記錄的寄存器值復(fù)原。 12.敲Ctrl-Z,退出配置狀態(tài)。 13.在特權(quán)模式下用writememory命令保存配置,然后reboot重啟。 思科路由器密碼恢復(fù)方法二 使用這種方法可使下列思科路由器密碼恢復(fù):Cisco1003、1600系列、3600系列、4500系列、7200系列、7500系列和IDTOrion-Based路由器,前四步和***種方法一樣。 5.在rommon>提示符下輸入confreg命令。 Doyouwishtochangeconfiguration[y/n]? 輸入yes,然后回車。在回答后面的問(wèn)題時(shí)一直選擇no,直到出現(xiàn)“ignoresystemconfiginfo[y/n]?”時(shí)輸入yes。接著繼續(xù)敲no回答,一直到看到“changebootcharacteristics[y/n]?”時(shí)輸入yes。 entertoboot:在這個(gè)提示符下可以有2和1兩種選擇。如果Flashmemoryiserased選擇1,這樣只能vieworerase配置,不能直接修改password。***選擇2。出現(xiàn)如下提示:Doyouwishtochangeconfiguration[y/n]?回答no,然后回車,顯示“rommon>”。 6.在特權(quán)EXEC下輸入reload命令。 思科路由器密碼恢復(fù)操作到這后,后面操作同***種方法。 
程序1完成這些步驟為了恢復(fù)您的密碼: 附加終端或PC有終端仿真的路由器的控制臺(tái)端口。 使用以下終端設(shè)置: 有關(guān)如何使用電纜將終端連接到控制臺(tái)端口或 AUX 端口的信息,請(qǐng)參閱以下文檔: 如果可以訪問(wèn)路由器,請(qǐng)?jiān)谔崾痉庢I入 show version,并且記錄配置寄存器設(shè)置。參見(jiàn)密碼恢復(fù)流程示例為了查看輸出的show version命令。 Note: 配置寄存器通常設(shè)置為0x2102或0x102。如果能不再訪問(wèn)路由器(由于未接通登錄或TACACS密碼),您能安全假設(shè),您的配置寄存器設(shè)置為0x2102。 請(qǐng)使用電源開(kāi)關(guān)為了關(guān)閉路由器,然后翻回路由器。 重要說(shuō)明: 按在終端鍵盤(pán)的中斷在60秒功率以內(nèi)為了舉起路由器到ROMmon。 如果中斷順序不起作用,請(qǐng)參閱口令恢復(fù)過(guò)程中的標(biāo)準(zhǔn)break鍵序列組合,獲取其他鍵組合。 在 rommon 1> 提示符處鍵入 confreg 0x2142,以便從閃存啟動(dòng)。 此步驟將會(huì)跳過(guò)存儲(chǔ)口令的啟動(dòng)配置。 鍵入重置在rommon 2>提示。 路由器重新啟動(dòng),但是忽略已保存的配置。 在每個(gè)設(shè)置問(wèn)題后鍵入 no 或按 Ctrl-C,跳過(guò)初始設(shè)置過(guò)程。 鍵入enable (event)在Router>提示。 您將進(jìn)入啟用模式,此時(shí)應(yīng)看到 Router# 提示符。 鍵入 configure memory 或 copy startup-config running-config,將非易失性 RAM (NVRAM) 復(fù)制到內(nèi)存中。 警告: 請(qǐng)勿鍵入 copy running-config startup-config 或執(zhí)行寫(xiě)操作。這些erase命令您的啟動(dòng)配置。 鍵入show running-config。 show running-config 命令將會(huì)顯示路由器的配置。在此配置中,在所有接口下將會(huì)出現(xiàn) shutdown 命令,顯示當(dāng)前關(guān)閉的所有接口。另外,密碼(特權(quán)密碼、enable secret、VTY,控制臺(tái)密碼)在加密或未加密的格式。您能重新使用未加密的密碼。您必須更改加密的密碼到一個(gè)新的密碼。 類型配置終端。 hostname(config)-提示出現(xiàn)。 鍵入 enable secret <password>,以更改 enable secret 口令。例如: hostname(config)#enable secret cisco
在所用的每個(gè)接口上發(fā)出 no shutdown 命令。 如果發(fā)出 show ip interface brief 命令,則要使用的每個(gè)接口都應(yīng)顯示 up up。 鍵入 config-register <configuration_register_setting>。其中 configuration_register_setting 的值為步驟 2 中記錄的值或 0x2102。例如: hostname(config)#config-register 0x2102
按 Ctrl-z 或 end,離開(kāi)配置模式。 主機(jī)名提示出現(xiàn)。 鍵入 write memory 或 copy running-config startup-config,以提交更改。
程序2完成這些步驟為了恢復(fù)您的密碼: 關(guān)閉路由器。 去除在路由器的返回的微型閃存。 在路由器的功率。 一旦Rommon1>提示出現(xiàn),請(qǐng)輸入此命令: confreg 0x2142
插入微型閃存。 鍵入重置。 當(dāng)提示您輸入初始配置時(shí),請(qǐng)鍵入沒(méi)有,并且按Enter。 在Router>提示,請(qǐng)鍵入enable (event)。 在Router-提示,請(qǐng)輸入configure memory命令,并且按Enter為了復(fù)制啟動(dòng)配置到運(yùn)行的配置。 請(qǐng)使用config t命令為了輸入全局配置模式。 請(qǐng)使用此命令為了創(chuàng)建一個(gè)新的用戶名和密碼: router(config)#username cisco privilege 15 password cisco
請(qǐng)使用此命令為了更改引導(dǎo)說(shuō)明: config-register 0x2102
請(qǐng)使用此命令為了保存配置: write memory
重新載入路由器,然后請(qǐng)使用新的用戶名和密碼登陸到路由器。
密碼恢復(fù)流程示例本部分提供了一個(gè)口令恢復(fù)過(guò)程的示例。此示例是使用 Cisco 2600 系列路由器創(chuàng)建的。即使您使用的不是 Cisco 2600 系列路由器,以下輸出也可為您的產(chǎn)品體驗(yàn)提供示例。 Router>enable Password: Password: Password: % Bad secrets
Router>show version Cisco Internetwork Operating System Software IOS (tm) C2600 Software (C2600-IS-M), Version 12.0(7)T, RELEASE SOFTWARE (fc2) Copyright (c) 1986-1999 by cisco Systems, Inc. Compiled Tue 07-Dec-99 02:21 by phanguye Image text-base: 0x80008088, data-base: 0x80C524F8
ROM: System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
Router uptime is 3 minutes System returned to ROM by abort at PC 0x802D0B60 System image file is "flash:c2600-is-mz.120-7.T"
cisco 2611 (MPC860) processor (revision 0x202) with 26624K/6144K bytes of memory. Processor board ID JAB031202NK (3878188963) M860 processor: part number 0, mask 49 Bridging software. X.25 software, Version 3.0.0. Basic Rate ISDN software, Version 1.1. 2 Ethernet/IEEE 802.3 interface(s) 2 Serial(sync/async) network interface(s) 1 ISDN Basic Rate interface(s) 32K bytes of non-volatile configuration memory. 8192K bytes of processor board System flash partition 1 (Read/Write) 8192K bytes of processor board System flash partition 2 (Read/Write)
Configuration register is 0x2102
Router>
!--- The router was just powercycled, and during bootup a !--- break sequence was sent to the router.
!
*** System received an abort due to Break Key ***
signal= 0x3, code= 0x500, context= 0x813ac158 PC = 0x802d0b60, Vector = 0x500, SP = 0x80006030 rommon 1 > confreg 0x2142
You must reset or power cycle for new config to take effect
rommon 2 > reset
System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1) Copyright (c) 1999 by cisco Systems, Inc. TAC:Home:SW:IOS:Specials for info C2600 platform with 32768 Kbytes of main memory
program load complete, entry point: 0x80008000, size: 0x6fdb4c
Self decompressing the image : ############################### ############################################################## ############################################################## ############################################################## ############################### [OK]
Restricted Rights Legend
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c) of the Commercial Computer Software - Restricted Rights clause at FAR sec. 52.227-19 and subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS sec. 252.227-7013.
cisco Systems, Inc. 170 West Tasman Drive San Jose, California 95134-1706
Cisco Internetwork Operating System Software IOS (tm) C2600 Software (C2600-IS-M), Version 12.0(7)T, RELEASE SOFTWARE (fc2) Copyright (c) 1986-1999 by cisco Systems, Inc. Compiled Tue 07-Dec-99 02:21 by phanguye Image text-base: 0x80008088, data-base: 0x80C524F8
cisco 2611 (MPC860) processor (revision 0x202) with 26624K/6144K bytes of memory. Processor board ID JAB031202NK (3878188963) M860 processor: part number 0, mask 49 Bridging software. X.25 software, Version 3.0.0. Basic Rate ISDN software, Version 1.1. 2 Ethernet/IEEE 802.3 interface(s) 2 Serial(sync/async) network interface(s) 1 ISDN Basic Rate interface(s) 32K bytes of non-volatile configuration memory. 8192K bytes of processor board System flash partition 1 (Read/Write) 8192K bytes of processor board System flash partition 2 (Read/Write)
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]: n
Press RETURN to get started!
00:00:19: %LINK-3-UPDOWN: Interface BRI0/0, changed state to up 00:00:19: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up 00:00:19: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to up 00:00:19: %LINK-3-UPDOWN: Interface Serial0/0, changed state to down 00:00:19: %LINK-3-UPDOWN: Interface Serial0/1, changed state to down 00:00:20: %LINEPROTO-5-UPDOWN: Line protocol on Interface BRI0/0, changed state to down 00:00:20: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up Router> 00:00:20: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to up 00:00:20: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down 00:00:20: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down 00:00:50: %SYS-5-RESTART: System restarted -- Cisco Internetwork Operating System Software IOS (tm) C2600 Software (C2600-IS-M), Version 12.0(7)T, RELEASE SOFTWARE (fc2) Copyright (c) 1986-1999 by cisco Systems, Inc. Compiled Tue 07-Dec-99 02:21 by phanguye 00:00:50: %LINK-5-CHANGED: Interface BRI0/0, changed state to administratively down 00:00:52: %LINK-5-CHANGED: Interface Ethernet0/0, changed state to administratively down 00:00:52: %LINK-5-CHANGED: Interface Serial0/0, changed state to administratively down 00:00:52: %LINK-5-CHANGED: Interface Ethernet0/1, changed state to administratively down 00:00:52: %LINK-5-CHANGED: Interface Serial0/1, changed state to administratively down 00:00:53: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down 00:00:53: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to down Router> Router>enable Router#copy startup-config running-config Destination filename [running-config]? 1324 bytes copied in 2.35 secs (662 bytes/sec) Router# 00:01:24: %LINEPROTO-5-UPDOWN: Line protocol on Interface BRI0/0:1, changed state to down 00:01:24: %LINEPROTO-5-UPDOWN: Line protocol on Interface BRI0/0:2, changed state to down Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#enable secret < password > Router(config)#^Z 00:01:54: %SYS-5-CONFIG_I: Configured from console by console Router#show ip interface brief
Interface IP-Address OK? Method Status Protocol Ethernet0/0 10.200.40.37 YES TFTP administratively down down Serial0/0 unassigned YES TFTP administratively down down BRI0/0 193.251.121.157 YES unset administratively down down BRI0/0:1 unassigned YES unset administratively down down BRI0/0:2 unassigned YES unset administratively down down Ethernet0/1 unassigned YES TFTP administratively down down Serial0/1 unassigned YES TFTP administratively down down Loopback0 193.251.121.157 YES TFTP up up Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface Ethernet0/0 Router(config-if)#no shutdown Router(config-if)# 00:02:14: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up 00:02:15: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up Router(config-if)#interface BRI0/0 Router(config-if)#no shutdown Router(config-if)# 00:02:26: %LINK-3-UPDOWN: Interface BRI0/0:1, changed state to down 00:02:26: %LINK-3-UPDOWN: Interface BRI0/0:2, changed state to down 00:02:26: %LINK-3-UPDOWN: Interface BRI0/0, changed state to up 00:02:115964116991: %ISDN-6-LAYER2UP: Layer 2 for Interface BR0/0, TEI 68 changed to up Router(config-if)#^Z Router# 00:02:35: %SYS-5-CONFIG_I: Configured from console by console Router#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] Router#show version Cisco Internetwork Operating System Software IOS (tm) C2600 Software (C2600-IS-M), Version 12.0(7)T, RELEASE SOFTWARE (fc2) Copyright (c) 1986-1999 by cisco Systems, Inc. Compiled Tue 07-Dec-99 02:21 by phanguye Image text-base: 0x80008088, data-base: 0x80C524F8
ROM: System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
Router uptime is 3 minutes System returned to ROM by abort at PC 0x802D0B60 System image file is "flash:c2600-is-mz.120-7.T"
cisco 2611 (MPC860) processor (revision 0x202) with 26624K/6144K bytes of memory. Processor board ID JAB031202NK (3878188963) M860 processor: part number 0, mask 49 Bridging software. X.25 software, Version 3.0.0. Basic Rate ISDN software, Version 1.1. 2 Ethernet/IEEE 802.3 interface(s) 2 Serial(sync/async) network interface(s) 1 ISDN Basic Rate interface(s) 32K bytes of non-volatile configuration memory. 8192K bytes of processor board System flash partition 1 (Read/Write) 8192K bytes of processor board System flash partition 2 (Read/Write)
Configuration register is 0x2142
Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#config-register 0x2102 Router(config)#^Z 00:03:20: %SYS-5-CONFIG_I: Configured from console by console
Router#show version Cisco Internetwork Operating System Software IOS (tm) C2600 Software (C2600-IS-M), Version 12.0(7)T, RELEASE SOFTWARE (fc2) Copyright (c) 1986-1999 by cisco Systems, Inc. Compiled Tue 07-Dec-99 02:21 by phanguye Image text-base: 0x80008088, data-base: 0x80C524F8
ROM: System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
Router uptime is 3 minutes System returned to ROM by abort at PC 0x802D0B60 System image file is "flash:c2600-is-mz.120-7.T"
cisco 2611 (MPC860) processor (revision 0x202) with 26624K/6144K bytes of memory. Processor board ID JAB031202NK (3878188963) M860 processor: part number 0, mask 49 Bridging software. X.25 software, Version 3.0.0. Basic Rate ISDN software, Version 1.1.
2 Ethernet/IEEE 802.3 interface(s) 2 Serial(sync/async) network interface(s) 1 ISDN Basic Rate interface(s) 32K bytes of non-volatile configuration memory. 8192K bytes of processor board System flash partition 1 (Read/Write) 8192K bytes of processor board System flash partition 2 (Read/Write)
Configuration register is 0x2142 (will be 0x2102 at next reload)
Router#
|