实验5: IOS的升级与恢复
?
實驗5:? IOS的升級與恢復(fù)
??? ?實驗?zāi)康?br />
通過本實驗可以掌握?? ?
1)?? ?掌握IOS 正常的情況下升級IOS
2)?? ?IOS 丟失的情況下使用TFTP恢復(fù)IOS
3)?? ?IOS 丟失的情況下使用Xmodem恢復(fù)IOS
?
拓撲結(jié)構(gòu)
?
?
?
?
實驗步驟
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?? ??????? //退到特權(quán)模式
Router#copy tftp: flash:?? ??????? //從 tftp 服務(wù)器拷貝 flash
Address or name of remote host []? 1.1.1.2?? ???? //指定服務(wù)器地址
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恢復(fù)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? (缺省網(wǎng)關(guān),是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
執(zhí)行tftpdnld命令進行ios升級,有時可能會報錯或命令不執(zhí)行,這時只要用sync命令保存配置后,重新啟動路由器(最好關(guān)掉電源再開機)后,再執(zhí)行tftpdnld命令就可以了。
rommon 9 >tftpdnld(傳送文件)出現(xiàn)提示選擇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),進入正常引導(dǎo)狀態(tài)
2)?? ?? IOS 丟失的情況下使用Xmodem恢復(fù)IOS
通過Xmodem命令(注:Xmodem與實際的modem沒有任何聯(lián)系 只是一個傳輸協(xié)議 數(shù)據(jù)是通過終端的串口和路由器的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 ……???? ?
(此時在超級終端的傳送欄目=> 選擇發(fā)送文件選項 => 再選擇Xmodem 并指明IOS映像文件所在的路徑,按發(fā)送即開始上傳IOS,等待時間很長,視IOS的大小和傳輸速度。)Erasing flash at 0x607c0000
program flash location 0x605b0000
Download Complete!
傳完以后,對整個系統(tǒng)初始化 顯示如下:
program load complete, entry point: 0x80008000, size: 0x5b85e0
Self decompressing the image :[OK]
…..
注釋:Router采用這種方法時,由于使用console口來傳送,速率為9600bps,需要時間較長。因此可修改console口速率利用xmodem命令實現(xiàn)快速升級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鍵前,需要修改串口速度(我的電腦--端口屬性--串口速度調(diào)為115200),然后再修改超級終端里設(shè)置速率為115200,記住,一定要這么做,否則會出現(xiàn)亂碼! 然后關(guān)閉這個超級終端,重新建立一個超級終端連接,重新啟動系統(tǒng)后,出現(xiàn)
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 ……
注釋:此時,在超級終端的菜單上的“傳送”--“發(fā)送文件”--選擇IOS映像文件所在地以及選擇使用“xmodem”協(xié)議,點擊“發(fā)送”即可。等待10-20分鐘左右就可升級完3-6M的IOS文件!待升級完成后,請記住修改回計算機串口與超級終端、路由器confreg下的xmodem等傳輸速率為9600bps.
方法如下:
Router>en 進入新IOS的特權(quán)模式
Router#reload 重啟系統(tǒng)
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秒內(nèi)按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最好關(guān)掉電源后,重新啟動。利用xmodem命令實現(xiàn)路由器IOS升級速度較慢,往往等上很長時間,為了快速升級,可以采用下列方法。
?
轉(zhuǎn)載于:https://www.cnblogs.com/zhongguiyao/p/8011923.html
總結(jié)
以上是生活随笔為你收集整理的实验5: IOS的升级与恢复的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: drag传递参数
- 下一篇: 算法导论第三版 21.2-3习题答案