熟練使用cisco rommon維護(hù)路由器 下篇
路由器flash中IOS文件的升級或損壞后的恢復(fù)
此種情況較為嚴(yán)重,它常常發(fā)生在對路由器IOS版本升級操作失誤或其它軟硬件故障原因?qū)е侣酚善飨到y(tǒng)崩潰無法進(jìn)行工作,致使整個網(wǎng)絡(luò)的癱瘓。
此時,我們常常需要在路由器的ROM Monitor模式下將其修復(fù)。
下面就以筆者的一個學(xué)生遇到的問題為例,做一探討。該生在對一臺cisco 2600路由器的IOS進(jìn)行升級時,出現(xiàn)如下故障:
- System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
- Copyright (c) 1999 by cisco Systems, Inc.
- TAC:Home:SW:IOS:Specials for info
- C2600 platform with 32768 Kbytes of main memory
- loadprog: bad file magic number: 0x0
- boot: cannot load "flash:"
- (路由器引導(dǎo)程序在重復(fù)上述過程,失敗后,進(jìn)入ROM Monitor模式)
- System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
- Copyright (c) 1999 by cisco Systems, Inc.
- TAC:Home:SW:IOS:Specials for info
- C2600 platform with 32768 Kbytes of main memory
- rommon 1 >boot 注:使用該命令,使路由器重新加載flash中的IOS文件,失敗。
- boot: cannot determine first file name on device "flash:"
注:在確定故障是由路由器不能確定flash中的IOS文件后,我們需要將IOS文件從TFTP Server中恢復(fù)到路由器的flash中。此時我們可是通過兩種方法完成此任務(wù):其一,使用安裝了cisco TFTP Server的PC機(jī)通過以太網(wǎng)對路由器IOS進(jìn)行恢復(fù),其二,在ROM Monitor模式下使用xmodem(一種能使用console電纜傳輸文件的傳輸協(xié)議)命令對路由器IOS進(jìn)行恢復(fù)。
在這里,我們優(yōu)先使用***種方法,其步驟為:
1. 將安裝了cisco TFTP Server的PC機(jī)通過以太網(wǎng)與路由器的以太網(wǎng)接口相連,運(yùn)行cisco TFTP Server 程序。
2. 使用超級終端登陸路由器console口控制臺(路由器已啟動,查詢故障時已登陸),終端屏幕顯示如下:
- rommon 2 > set
- 注:該命令顯示路由器相關(guān)默認(rèn)設(shè)置
- PS1=rommon ! >
- IP_ADDRESS=192.168.1.1
- IP_SUBNET_MASK=255.255.255.0
- DEFAULT_GATEWAY=192.168.1.2
- TFTP_SERVER=192.168.1.2
- TFTP_TIMEOUT=20000
- TFTP_RETRY_COUNT=10
- TFTP_FILE=/c2600-ik8o3s-mz.122-11.T/
- ?=1
#p#
3. 檢查路由器的默認(rèn)設(shè)置,將PC機(jī)的IP地址改為192.168.1.2(我們同樣可以使用命令TFTP_SERVER=192.168.1.x修改該設(shè)置,但要保證路由器的IP、默認(rèn)網(wǎng)關(guān)與PC機(jī)的IP在統(tǒng)一網(wǎng)段),這樣更簡單。
4. 指定要恢復(fù)的IOS文件名,并保證該文件在cisco TFTP Server根目錄下。
rommon 3 > TFTP_FILE=/c2600-i-mz.121-3.T.bin 注:不要忘記加上擴(kuò)展文件名.bin
5. 開始恢復(fù)IOS文件:
- rommon 4 > tftpdnld
- 注:執(zhí)行該命令從TFTF Server下載IOS文件到flash,該命令僅適用于cisco 2600系列路由器。
- IP_ADDRESS: 192.168.1.1
- IP_SUBNET_MASK: 255.255.255.0
- DEFAULT_GATEWAY: 192.168.1.2
- TFTP_SERVER: 192.168.1.2
- TFTP_FILE: /c2600-i-mz.121-3.T.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.121-3.T.bin from 192.168.1.2 !!!!!!!!!(確認(rèn)后,路由器開始下載IOS文件,省略多行。)
- File reception completed.
- Copying file /c2600-i-mz.121-3.T.bin to flash.
- Erasing flash at 0x60fc0000
- program flash location 0x60160000
6. 重新啟動路由器,運(yùn)行新的IOS
- rommon 5 > reset
- System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
- Copyright (c) 1999 by cisco Systems, Inc.
- TAC:Home:SW:IOS:Specials for info
- C2600 platform with 32768 Kbytes of main memory
- program load complete, entry point: 0x80008000, size: 0x487758
- Self decompressing the image : #########(下面為正常的啟動過程,故省略)
提示:Cisco ROM Monitor模式下還有其他很多不同功能的命令,我們可以使用它們對路由器進(jìn)行一系列的測試與排錯,有關(guān)該模式的詳細(xì)說明請?jiān)L問cisco 站點(diǎn):[url]www.cisco.com[/url],進(jìn)行相關(guān)搜索,搜索關(guān)鍵字:Using the ROM Monitor。
路由器flash中IOS文件的升級或損壞后的恢復(fù)過程就為大家介紹完了,希望大家已經(jīng)掌握。
【編輯推薦】