標籤:new 狀態 filename nbsp syn ima copyright 升級 end
實驗5: IOS的升級與恢複
實驗目的
通過本實驗可以掌握
1) 掌握IOS 正常的情況下升級IOS
2) IOS 丟失的情況下使用TFTP恢複IOS
3) IOS 丟失的情況下使用Xmodem恢複IOS
拓撲結構
實驗步驟
n IOS 正常的情況下升級IOS (TFTP)
Router#conf t //進入配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0 //進入介面
Router(config-if)#ip add 1.1.1.1 255.255.255.0 //配置 IP 位址
Router(config-if)#no shut //啟用介面
Router(config-if)#end //退到特權模式
Router#copy tftp: flash: //從 tftp 伺服器拷貝 flash
Address or name of remote host []? 1.1.1.2 //指定伺服器位址
Source filename []? c2600-d-mz.122-1.bin
Destination filename [c2600-d-mz.122-1.bin]?
Loading c2600-d-mz.122-1.bin from 1.1.1.2:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 50938004 bytes]
n IOS 丟失的情況下使用TFTP恢複IOS
1) 通過tftpdnld命令升級IOS
rommon 3 >IP_ADDRESS=10.32.10.1 (路由器的ip地址)
rommon 4 >IP_SUBNET_MASK=255.255.255.0 (路由器的掩碼)
rommon 5 >DEFAULT_GATEWAY=10.32.10.32 (預設網關,是pc機的ip)
rommon 6 >TFTP_SERVER=10.32.10.32 (是pc機的ip地址)
rommon 7 >TFTP_FILE=C2600-I-MZ.122-11.BIN (上傳ios檔案的名稱)
rommon 8 >tftpdnld
執行tftpdnld命令進行ios升級,有時可能會報錯或命令不執行,這時只要用sync命令儲存配置後,重新啟動路由器(最好關掉電源再開機)後,再執行tftpdnld命令就可以了。
rommon 9 >tftpdnld(傳送檔案)出現提示選擇y
IP_ADDRESS: 10.32.10.1
IP_SUBNET_MASK: 255.255.255.0
DEFAULT_GATEWAY: 10.32.10.32
TFTP_SERVER: 10.32.10.32
TFTP_FILE: C2600-I-MZ.122-11.BIN
Invoke this command for disaster recovery only.
WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n: [n]: y
Receiving C2600-I-MZ.122-11.BIN from 10.32.10.3
…
File reception completed.Copying file C2600-I-MZ.122-11.BIN to flash.
Erasing flash at 0x607c0000
ogram flash location 0x605b0000
rommon 10 >
在rommon 13 >提示符下鍵入reset,或重新啟動路由器(power-cycle),進入正常引導狀態
2) IOS 丟失的情況下使用Xmodem恢複IOS
通過Xmodem命令(註:Xmodem與實際的modem沒有任何聯絡 只是一個傳輸協議 資料是通過終端的串口和路由器的Console口灌進去的)升級IOS,具體步驟如下:
1、用Cisco原配的線纜連線路由器的console口與PC機的COM1,使用PC機的超級終端軟體訪問路由器,這時不需要對PC和路由器配置任何地址。
2、在這個模式下,輸入Xmodem命令,即:
rommon 2 > xmodem -c c2600-i-mz.122-11.bin
(-c是帶校正,c2600-i-mz.122-11.bin為存放在PC機上的IOS映像檔案)
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 c2600-i-mz.122-11.bin ……
(此時在超級終端的傳送欄目=> 選擇傳送檔案選項 => 再選擇Xmodem 並指明IOS映像檔案所在的路徑,按發送即開始上傳IOS,等待時間很長,視IOS的大小和傳輸速度。)Erasing flash at 0x607c0000
program flash location 0x605b0000
Download Complete!
傳完以後,對整個系統初始化 顯示如下:
program load complete, entry point: 0x80008000, size: 0x5b85e0
Self decompressing the image :[OK]
…..
注釋:Router採用這種方法時,由於使用console口來傳送,速率為9600bps,需要時間較長。因此可修改console口速率利用xmodem命令實現快速升級IOS.具體方法如下:
rommon 1 > confreg 斷行符號
Configuration Summary
enabled are:
load rom after netboot fails
console baud: 9600
boot: image 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 brocast 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,用最大的11520速率的xmodem傳輸)
change the boot characteristics? y/n [n]: n (選擇 no)
Configuration Summary
enabled are:
load rom after netboot fails
console baud: 115200
boot: image specified by the boot system commandsor 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
注釋: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等傳輸速率為9600bps.
方法如下:
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 = 0x8000468 monitor: command "boot" aborted due to user interrupt
30秒內按ctrl+break鍵
rommon 1 > confreg ( 輸入“confreg”命令)
Configuration Summary
enabled are:load rom after netboot fails
console baud: 115200
boot: image 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 nn IP brocast 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: image 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最好關掉電源後,重新啟動。利用xmodem命令實現路由器IOS升級速度較慢,往往等上很長時間,為了快速升級,可以採用下列方法。
實驗5: IOS的升級與恢複