實驗目的:
咱們通常在工做中,常常會遇到IOS莫名其妙的丟失,有時候很忽然,有時候很棘手,若是網絡由於你的失誤而中斷,你的責任會很重要,因此你們必定要掌握恢復IOS的方法。
實驗拓撲:
pc
實驗步驟:
IOS丟失之後,全部的設備都會啓動最小啓動模式。
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灌進去了! 須要主意的是,這是科學估算時間和實際的時間相差很遠,實際若是10幾M的話要3個多小時。但願你們預備好咖啡和甜品準備漫長的等待,本人深有體會,呵呵!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(修改回計算機串口與超級終端、路由器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
( 最好關電源)
而後關閉這個超級終端,從新創建一個超級終端鏈接,一切就OK了
經過Xmodem升級2610的IOS實例
若是你不當心使用了命令erase flash 那麼發生什麼就可想而知了。所以,建議在你拿到路由器等網絡設備時 最好先將它的IOS等操做系統備份出來,以備萬一!
本篇主要介紹經過Xmodem上傳IOS的過程(以2610爲例,不過這個方法用在其餘設備上沒什麼太大區別)
準備工做,只要有Cisco原配的線纜就能夠(注:Xmodem與實際的modem沒有任何聯繫 只是一個傳輸協議 數據是經過終端的串口和路由器的Console口灌進去的)
在沒有IOS的狀況下 系統只能進入Rommon狀態,在這個狀態下只能見到以下命令:
rommon 8 > ?
alias set and display aliases command
boot boot up an external process
break set/show/clear the breakpoint
confreg configuration register utility
cont continue executing a downloaded p_w_picpath
context display the context of a loaded p_w_picpath
cookie display contents of cookie PROM in hex
dev list the device table
dir list files in file system
dis display instruction stream
dnld serial download a program module
frame print out a selected stack frame
help monitor builtin command help
history monitor command history
meminfo main memory information
repeat repeat a monitor command
reset system reset
set display the monitor variables
stack produce a stack trace
sync write monitor environment to NVRAM
sysret print out info from last system return
tftpdnld tftp p_w_picpath download
unalias unset an alias
unset unset a monitor variable
xmodem x/ymodem p_w_picpath download
在這個模式下,輸入Xmodem
rommon 9 > xmodem
會提示以下警告:
WARNING: All existing data in bootflash will be lost!
Invoke this application only for disaster recovery.
Do you wish to continue? y/n [n]: y
Ready to receive file ? ...
而後在超級終端的傳送欄目=> 選擇發送選項 => 再選擇Xmodem 並指明IOS所在的路徑即開始上傳IOS,等待時間很長,視IOS的大小和傳輸速度。對於初次作IOS上傳,建議不要去修改什麼傳輸速率。傳完之後 對整個系統初始化 界面以下:
Erasing flash at 0x603c0000
program flash location 0x602f0000
Download Complete!
program load complete, entry point: 0x80008000, size: 0x2f0074
Self decompressing the p_w_picpath : #################################################
################################################################################
################################################################################
################################################################# [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-I-M), Version 11.3(6)T, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-1998 by Cisco Systems, Inc.
Compiled Tue 06-Oct-98 18:42 by ccai
Image text-base: 0x80008084, data-base: 0x80554578
Cisco 2610 (MPC860) processor (revision 0x202) with 12288K/4096K bytes of memory
.
Processor board ID JAB0233005Z (3677578902)
M860 processor: part number 0, mask 32
Bridging software.
X.25 software, Version 3.0.0.
1 Ethernet/IEEE 802.3 interface(s)
1 Serial network interface(s)
32K bytes of non-volatile configuration memory.
4096K bytes of processor board System flash (Read/Write)
Press RETURN to get started!
00:00:06: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
00:00:06: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
00:00:06: %SYS-5-CONFIG_I: Configured from memory by console
00:00:06: %SYS-5-RESTART: System restarted --
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 11.3(6)T, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-1998 by Cisco Systems, Inc.
Compiled Tue 06-Oct-98 18:42 by ccai
00:00:07: %LINEPROTO-5-UPDOWN: Line protocol on
WL_bank_2610_2>Interface Ethernet0/0, changed state to up
00:00:07: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed sta
te to up
00:00:07: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed sta
te to up
實驗總結: 我有過這樣的經歷,由於沒有及時修復IOS而獲得上級的責備,有些時候這些技能都是咱們必須掌握的。