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