CISCO-路由器交換機IOS被刪,恢復方法

方式一,tftpdnld方式恢復Router 2600 IOS

1)    將計算機串口和路由器console口相連

必定將計算機網口與路由器第一個以太口f0/0相連.

2)    啓動TFTP服務器,並將要下載的版本放於指定目錄下面

3)    冷啓動路由器,在開機的前60秒以內,按住「Ctrl+Break」鍵

4)    這時系統會進入災難恢復模式,其提示符爲「Rommon1>5)    Rommon1>IP_ADDRESS=192.168.1.2  (設置f0/0口的IP地址爲192.168.1.26)    Rommon2>IP_SUBNET_MASK=255.255.255.0 (設置子網掩碼255.255.255.0)

7)    Rommon3>DEFAULT_GATEWAY=192.168.1.254  (缺省網關隨便設置)

8)    Rommon4>TFTP_SERVER=192.168.1.1  (設置TFTP服務器的IP地址192.168.1.2549)    Rommon5>TFTP_FILE=c2600-ik8o3s-mz.122-11.T.bin (即TFTP服務器上備份IOS的文件名)

10) Rommon6> tftpdnld  (準備複製IOS映像,注意:前面的幾條命令必須使用大寫,而最後的tftpdnld則要用小寫,並且保證TFTP是打開的 )

Do you wish to continue? y/n: [n]: y

Receiving c2600-ik8o3s-mz.122-11.T.bin from 192.168.1.1

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Rommon8>reset 

 

又回到了熟悉的IOS模式下輸。當文件傳輸完後,將自動回到命令甚至連之前配置的信息都不會丟失服務器

查看下配置寄存器的值,若是不正確(如:Configuration register is 0x3922)app

咱們須要修改成0x2102ui

Router(config)#config-register 0x2102

Router# reload

 

方式二,xmodem 方式恢復Router 2600/3600 IOSthis

1)       用PC終端鏈接路由器發console口,打開沒有IOS的路由器,路由器會進入監控模式(rommon);spa

2) 爲了提升數據傳輸速度,首先更改路由器的傳輸速率,在rommon模式,輸入:rommon1>confreg (回車) 根據提示,只選擇修改傳輸速率級別爲7(115200),其它參數爲系統默認操作系統

過程:3d

rommon 1>confreg

do you wish to change the configuration? y/n [n]: y

disable "diagnostic mode"? y/n [n]: n

enable "use net in IP bcas

disable "load rom after netboot fails"? y/n [n]: n

enable "use all zero broadcast"? y/n [n]: n

disable "break/abort has effect"? y/n [n]: n

enable "ignore system config info"? y/n [n]: n

change console baud rate? y/n [n]: y

enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400

4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [7]: 7

change the boot characteristics? y/n [n]: n

do you wish to change the configuration? y/n [n]: n

rommon 2>reset      

 

3) 修改完傳輸速率,斷開PC終端鏈接,以115200速率鏈接路由器(不然會出現亂碼)code

繼續輸入:blog

會提示以下警告:路由

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    (系統提示是否確認該操做,選Y繼續)

Ready to receive file ... §§   (出現§字符,路由器等待接收數據)

 

4) 傳送IOS文件 :

在PC終端的界面,點擊"傳送"菜單>"傳送文件" :在彈出的對話框選擇IOS文件與傳輸協議(Xmodem)

點擊發送按鈕,開始傳送IOS文件;

整個傳輸過程爲30分鐘-1小時30分左右,視具體狀況而言

 

5) 當上一步驟IOS文件傳送完畢,系統會自動加載IOS文件到RAM運行,提示以下:

Download Complete! program load complete, entry point: 0x80008000, size: 0xf7258c Self decompressing the image : #################################################

################################################################################ ################################################################################

#################################################### [OK]

回車直到出現熟悉的提示語句 Press RETURN to get started

這時,千萬不要重啓,由於IOS尚未灌入flash中(能夠用show flash查看),只在RAM中

咱們須要用前面講過的正常的上傳IOS方法,使用100M速率再傳一次IOS

Copy tftp flash

 

6) 查看路由器信息:

R2620# show flash       這時flash中就會有操做系統了

R2620# show version     最後一行的寄存器值也不是正常的0X2102

 

7) 恢復路由器正常設置

R2620(config)#line console 0

R2620(config-line)#speed 9600     修改console口傳輸速率

斷開終端鏈接,以正常速率(9600)鏈接路由器,查看信息:

R2620(config-line)#exit

R2620(config)# config-register 0x2102 \\修改配置寄存器的值爲正常值

R2620#reload

System configuration has been modified. Save? [yes/no]: y

Building configuration...

[OK]

Proceed with reload? [confirm]

R2620# show version \\最後一行的寄存器正常了,爲0X2102

 

Xmodem 方式恢復Switch 2950:

1.       拔下交換機電源,用手按住交換機「Mode」 按鈕,插上電源,等待交換機進入控制檯模式。其提示符爲「switch: 」

 

2.執行命令flash_init和load_helper

switch: flash_init        初始化flash文件系統 
switch: load_helper      加載load_helper命令


3.執行命令dir flash,以查看閃存的內容:

switch: dir flash         閃存中沒有IOS映像
unable to stat flash/: permission denied
switch: set BAUD 115200    設置交換機的console口傳輸速率是115200

這時,斷開超級終端鏈接,設置傳輸速率也爲115200,再鏈接,不然出現亂碼

 

4.執行命令:copy xmodem:flash:filename,其中filename是硬盤中IOS到文件名,中應用程序「超級終端」中,選擇菜單「傳輸」--->「發送文件」,協議選xmode

 

5.啓動交換機,並修改console傳輸速率

switch:boot   #重啓進入switch>模式

6.而後show version;show flash   #覈實操做系統

7.恢復路由器正常設置

switch(config)# line console 0 
switch(config)# speed 9600    #設置交換機console傳輸速率爲9600
相關文章
相關標籤/搜索