在rommon狀態下對思科(Cisco)路由器升級IOS方法的兩種方法

由於不小心使用了命令erase flash或升級失敗後或在開啓(某些型號)Cisco路由器的電源開關後30秒內按下Ctrl+break鍵,中斷路由器的正常啓動,路由器都會進入rom監視模式,即 rommon 1>,在這種情形下,對路由器的IOS進行升級,情況要稍微複雜一點,在rommon狀態下有兩種升級IOS方法:
第一種通過Xmodem命令升級IOS:
(注:Xmodem與實際的modem沒有任何聯繫 只是一個傳輸協議 數據是通過終端的串口和路由器的Console口灌進去的)
具體步驟如下:
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升級速度較慢,往往等上很長時間,爲了快速升級,可以採用下列方法。

第二種方法: 通過tftpdnld命令升級IOS,具體步驟如下:
1、用Cisco原配的線纜連接思科路由器的console口與PC機的COM1,使用PC機的超級終端軟件訪問路由器;用一根雙絞線連接路由器的eth0/0口與PC機的網卡。

2、將路由器的eth0/0口IP地址設爲10.32.10.32;PC機的IP地址設爲10.32.10.1.將要升級的IOS映象文件拷貝到相關的目錄中,並運行TFTP服務器軟件,通過菜單設置Root目錄爲拷貝IOS映象文件所在目錄。

3、通過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),進入正常引導狀態。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章