首先需要有IOS文件,如果沒有備份原文件的話,可以找個同一版本的IOS來替代。
第一種方法:X-Modem
以前我曾經嘗試過一種方法,就是當Flash被刪除後,啓動無法進入系統,可以用X-Modem來恢復它。當時我不小心刪除了一臺Cisco2950交換機的Flash IOS,導致系統無法啓動,在查過不少資料後得到一個結論:唯一的方法通過X-Modem來恢復。我的恢復方法如下:
1、用控制線連接交換機console口與計算機串口1,用帶有xmodem功能的終端軟件連接(win2000 and xp的超級終端就帶這功能)。
2、設置連接方式爲串口1(如果連接的是其他串口就選擇其他串口),速率9600,無校驗,無流控,停止位1。或者點擊默認設置也可以。
3、連接以後計算機回車出現交換機無ios的界面,一般的提示符是:switch:
4、拔掉交換機後的電源線重新啓動交換機
5、在超級終端輸入:
switch:flash_init
會出現如下提示:
Initializing Flash...
6:輸入拷貝指令:
switch:copy xmodem: flash:p_w_picpath_filename.bin
出現如下提示:
Begin the Xmodem or Xmodem-1K transfer now...
7、系統提示不斷出現C這個字母就可以開始傳文件了
8、點擊超級終端菜單:傳送---發送文件,在協議選項中選擇Xmodem或者Xmodem-1K協議,然後選擇ios的影像文件(*.bin),開始傳送。
9、因爲不能改速率,所以傳送得很慢,我的大概傳送了80分鐘左右,請耐心等待。
10、傳送完畢後提示:
File "xmodem:" successfully copied to ....
switch:
11、在提示符下輸入
switch:boot
啓用新的ios系統
12、重新加電完成恢復工作。
這個是我恢復的方法,現在看來非常的不科學,效率低。後來看了別人同樣用X-Modem恢復IOS,但是效率要高的方法:
先打開超級終端,進入rommon 模式(Ctrl+Break組合鍵),鍵入confreg, 如下:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rommon 1 > confreg 回車
Configuration Summary
enabled are:
load rom after netboot fails
console baud: 9600
boot: p_w_picpath specified by the boot system commands
or default to: cisco2-C2600
do you wish to change the configuration? y/n [n]: y (選擇 yes)
enable "diagnostic mode"? y/n [n]: n (選擇 no)
enable "use net in IP bcast address"? y/n [n]: n (選擇 no)
disable "load rom after netboot fails"? y/n [n]: n (選擇 no)
enable "use all zero broadcast"? y/n [n]: n (選擇 no)
enable "break/abort has effect"? y/n [n]: n (選擇 no)
enable "ignore system config info"? y/n [n]: n (選擇 no)
change console baud rate? y/n [n]: y (選擇 yes)
enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400
4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [0]: 7 (選擇 7,用最大的115200速率的xmodem傳輸)
change the boot characteristics? y/n [n]: n (選擇 no)
Configuration Summary
enabled are:
load rom after netboot fails
console baud: 115200
boot: p_w_picpath specified by the boot system commands
or default to: cisco2-C2600
do you wish to change the configuration? y/n [n]: n (選擇 no)
You must reset or power cycle for new config to take effect
rommon 2 > reset 回車
注意:在此時鍵入 reset鍵之前,開始定義串口速度(我的電腦---端口屬性----串口速度調爲115200),然後再修改超級終端裏設置速率爲115200,記住,一定這麼做!否則出現亂碼!然後關閉這個超級終端,重新建立一個超級終端連接,(期間系統重新啓動)啓動後,出現
rommon 1> 提示符
然後,輸入
rommon 1> xmodem -r
Do not start the sending program yet...
Invoke this application only for disaster recovery.
Do you wish to continue? y/n [n]: y (選擇 yes)
Ready to receive file ...
此時,在超級終端的菜單上的“傳送”---“發送文件”----選擇IOS鏡像文件所在地以及選擇使用“xmodem”協議,點擊“發送”即可
然後等待10-20分鐘左右就把3-6M的IOS灌進去了!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(修改回計算機串口與超級終端、路由器confreg下的xmodem等9600的傳輸速率)
(videre注:實際用的時候,我發現這個命令總是改不成功,後來發現在line con 0下面有了一個speed 115200,所以即使改register成功,啓動以後router又執行speed 115200,還是不行,所以如果有這個問題,記得把這個語句no掉)
Router>en 進入新IOS的特權模式
Router#reload 重啓系統
Proceed with reload? [confirm] 回車
00:01:04: %SYS-5-RELOAD: Reload requested
System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
Copyright (c) 1999 by cisco Systems, Inc.
TAC:Home:SW:IOS:Specials for info
PC = 0xfff0a530, Vector = 0x500, SP = 0x680127b0
C2600 platform with 24576 Kbytes of main memory
PC = 0xfff0a530, Vector = 0x500, SP = 0x80004684
monitor: command "boot" aborted due to user interrupt
rommon 1 > confreg ( 輸入“confreg”命令)
Configuration Summary
enabled are:
load rom after netboot fails
console baud: 115200
boot: p_w_picpath specified by the boot system commands
or default to: cisco2-C2600
do you wish to change the configuration? y/n [n]: y (選擇 yes)
enable "diagnostic mode"? y/n [n]: n (選擇 no)
enable "use net in IP bcast address"? y/n [n]: n (選擇 no)
disable "load rom after netboot fails"? y/n [n]: n (選擇 no)
enable "use all zero broadcast"? y/n [n]: n (選擇 no)
enable "break/abort has effect"? y/n [n]: n (選擇 no)
enable "ignore system config info"? y/n [n]: n (選擇 no)
change console baud rate? y/n [n]: y (選擇 yes)
enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400
4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [7]: 0 (選擇 0,改回用標準速率速率9600的xmodem傳輸)
change the boot characteristics? y/n [n]: n (選擇 no)
Configuration Summary
enabled are:
load rom after netboot fails
console baud: 9600
boot: p_w_picpath specified by the boot system commands
or default to: cisco2-C2600
do you wish to change the configuration? y/n [n]: n
You must reset or power cycle for new config to take effect
rommon 2 >
此時手工改回計算機串口與超級終端2者傳輸速率爲9600
然後敲入
rommon 2 >reset
( 最好關電源)