2024年4月7日发(作者:)

Cisco路由器IOS映像恢复及升级方法

一、Cisco 1000,1600,2500,4000系列

1、IOS映像恢复的方法及步骤

1) 连接PC的COM1口与路由器的console口,使用PC的超级终端软件访问该路由器;

2) 开启路由器的电源开关,并在30秒内按下键盘的Ctrl+break,中断路由器的正常启

动以进入rom监视模式,屏幕上提示符如下:

>

3) 键入如下命令:

>o /r 0x2101

改变路由器虚拟寄存器的默认值(0x2102);

4) 键入重启命令:

>i

路由器重启,当屏幕显示以下信息表明路由器重启完毕:

System Bootstrap, Version 5.2(8a), RELEASE SOFTWARE

Copyright (c) 1986-1995 by cisco Systems

2500 processor with 1024 Kbytes of main memory

Press RETURN to get started!

5) 路由器在虚拟寄存器的值为0x2101时自动进入rom启动模式:

router(boot)>

6) 此时,将TFTP服务器上的IOS映像文件恢复至路由器flash memory中,依次键入

以下命令:

router(boot)>en

router(boot)#copy tftp flash

System flash directory:

No files in System flash

[0 bytes used, 4194304 available, 4194304 total]

Address or name of remote host [255.255.255.255]?192.168.18.168(IP地址已作技术处理,

下同)

Source file name? (IOS映像文件名)

Destination file name []?

Accessing file '' on 192.168.

Loading from 192.168.18.168 (via Ethernet0): ! [OK]

Device needs erasure before copying new file

Erase flash device before writing? [confirm]

Copy '' from server

as '' into Flash WITH erase? [yes/no]y

eeeeeeeeeeeeeeee ...erased

Loading from 192.168.18.168 (via Ethernet0): (!表示

恢复成功)

7) 还原路由器虚拟寄存器的默认值(0x2102),恢复路由器的正常启动顺序,依次键入

以下命令:

router(boot)#conf t

router(boot)(config)#config-register 0x2102

router(boot)(config)#exit

router(boot)#wr

router(boot)#reload

2、IOS映像升级的方法及步骤

1) 升级之前先备份,将相关文件备份至TFTP服务器,键入如下命令:

router#copy bootflash tftp(Cisco 2500系列路由器不存在bootflash,相应的是rom)

router#copy flash tftp

router#copy startup-config tftp

2) 因为Cisco 1000,1600,2500,4000系列路由器不允许在正常工作状态下重写flash

memory,所以只有进入rom(或bootflash)启动模式才能升级IOS映像,依次键入以下命

令:

router#conf t

router(config)#config-register 0x2101

router(config)#exit

router#wr

router#reload

3) 路由器重启完毕后进入rom(或bootflash)启动模式,从TFTP服务器将新的IOS

映像文件拷贝至路由器的flash memory中:

router(boot)#copy tftp flash

4) 还原路由器虚拟寄存器的默认值(0x2102),恢复路由器的正常启动顺序,依次键入

以下命令:

router(boot)#conf t

router(boot)(config)#config-register 0x2102

router(boot)(config)#exit

router(boot)#wr

router(boot)#reload

二、Cisco 1700,2600,3600,7200系列

1、IOS映像恢复的方法及步骤

1) 连接PC的COM1口与路由器的console口,使用PC的超级终端软件访问该路由器;

2) 开启路由器的电源开关,并在30秒内按下键盘的Ctrl+break,中断路由器的正常启

动以进入rom监视模式,屏幕上提示符如下:

rommon 1>

3) 键入xmodem命令:

rommon 1>xmodem (IOS映像文件名)

4) 然后,路由器一直等待从PC上接收该IOS映像文件,此时在超级终端软件中点击

发送选项,选择存放在PC本地硬盘中的IOS映像文件,确定后即开始下载文件至路由器的

flash memory中,由于通讯带宽只有9600波特,整个文件下载时间约为1.5小时(依文件大

小而定),屏幕显示信息如下:

Do not start the sending

device does not contain a valid magic number

dir: cannot open device flash:

WARNING: All existing data in flash will be lost!

Invoke this application only for disaster recovery.

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

Ready to receive file ...

Erasing flash at 0x307c0000

program flash location 0x30380000

Download Complete!

program load complete, entry point: 0x80008000, size: 0x38f410

5) 接着,路由器将自动重启,屏幕显示信息如下:

Self decompressing the image : ################################# [OK]

Press RETURN to get started!

2、IOS映像升级的方法及步骤

1) 同理,升级之前先备份,将关键文件备份至TFTP服务器,键入下列命令: router#copy

bootflash tftp(Cisco 3600系列路由器不存在bootflash)

router#copy flash tftp

router#copy startup-config tftp

2) 因为Cisco 1700,2600,3600,7200系列路由器允许在正常工作状态下重写flash

memory,所以直接键入以下命令就可完成IOS映像的在线升级:

router#copy tftp flash

router#reload

或者,为保险起见(以路由器停止服务为代价),在进入rom监视模式后才进行IOS映

像的升级,则依次进行下列操作:

2) 在路由器重启加电后30秒内按下键盘的Ctrl+break,中断路由器的正常启动直接进

入rom监视模式,屏幕上提示符如下:

rommon 1>

或者,在路由器重启过程完成后进行以下操作,同样可以进入路由器的rom监视模式:

router#conf t

router(config)#config-register 0x0

router(config)#exit

router#wr

router#reload

rommon 1>

3) 键入以下命令,将IOS映像的升级文件从TFTP服务器复制至路由器的flash memory

中:

rommon 1>b c3640-i-mz.121-2.T 192.168.18.168

program load complete, entry point: 0x80008000, size: 0x4ed478

Self decompressing the image : ##################################[OK]

Loading c3640-i-mz.121-2.T from 192.168.18.168 (via Ethernet0/0):

[OK - 5166484/10332160 bytes]

4) 还原路由器虚拟寄存器的默认值(0x2102),恢复路由器的正常启动顺序,依次键入

以下命令:

rommon 1>confreg 0x2102

5) 键入重启命令,使得新配置生效,完成IOS映像的离线升级:

rommon 2>reset

路由器IOS软件升级方法时间:2003-02-09 08:00来源:中国网管联盟 bitsCN编辑字体:[大 中

小]

1,在Windows操作系统的计算机上安装Cisco TFTP Server软件(文件名为

);

2,用Winzip软件将文件进行解压,解压后的文件名为

,将此文件拷入硬盘中一子目录,如D:cisco。

3,启动Cisco TFTP Server软件;

4,在TFTP Server软件界面上选择“View”――“Options”,在Options界面上,在“TFTP

Server root”选项上选择“Browse”,将该目录指向文件所在的目录,如

D:cisco或其它。

5,进入要升级的路由器下,将以太网的地址配置成与安装TFTP软件的计算机在同一

个网段,并能ping通该计算机(其实也可以不在同一网段,只要能保证能ping通即可)。

6,在路由器特权状态下(如Router#下),键入Copy tftp flash

系统提示:Address or name of remote host [ ]?时键入TFTP软件所在机器IP地址。

系统提示:Source filename [ ]?时键入要升级的IOS软件文件名,在例中为c2500-i-l(此

处为字母l,不是数字1).11(这两个是数字1,不是字母l)(注意.Bin不能丢)。

系统提示Destination filename [ ]?时,直接回车即可,表示和源文件名一致。

后面还有其它提问,按提示操作即可(如还有提示删除以前的IOS文件,以及确认消

息等)。

等待系统提示完成时,升级过程完成。

整个过程大约2-3分钟。

7,重新启动。

注意,在升级过程中,千万不可断电或造成路由器与TFTP服务器的网络不畅等问题!

【流行网络技术】CISCO路由器IOS升级方法总结

《CCIE建策科技-CISCO思科培训》

前不久,朋友在对一台带语音模快的CISCO2610进行IOS升级时,由于路

由器的内存(flash)为8M,IOS软件为7M多,升级后路由器无法正常启

动。启动后到rommon 1 >状态,请求帮助。由于本人长期从事计算机网

络管理工作,在对CISCO路由器的长期日常维护和管理实践中积累了一定

的经验。现总结归纳出CISCO路由器IOS映像升级的几种方法,供广大网

络爱好者或同仁参考。在介绍CISCO路由器IOS升级方法前,有必要对

Cisco路由器的存储器的相关知识作以简单介绍。路由器与计算机相似,

它也有内存和操作系统。在Cisco路由器中,其操作系统叫做互连网操作

系统(Internetwork Operating System),常简称为IOS.路由器的存储

器主要有:

ROM:只读存储器包含路由器正在使用的IOS的一份副本;

RAM:IOS将随机访问存储器分成共享和主存。主要用来存储运行

中的路由器配置和与路由协议有关的IOS数据结构;

FLASH (闪存):用来存储IOS软件映像文件,闪存是可以擦除

内存,它能够用IOS的新版本覆写,IOS升级主要是闪存中的IOS映像文

件进行更换。

NVRAM:非易失性随机访问存储器,用来存储系统的配置文件。

IOS升级方法一

在对能够正常启动的CISCO路由器的IOS进行升级时,比较简单。

具体步骤如下:

1、寻找一种TFTP服务器软件(有CISCO公司的TFTPServer或

3COM公司的3Cserver等,在升级较大IOS映象文件时,建议用3Cserver),

安装在一台计算机上,将要升级的IOS映象文件拷贝到相关的目录中(例:

D:),并运行TFTP服务器软件,通过菜单设置Root目录为拷贝IOS

映象文件所在目录(如D:)。假设该计算机的IP地址为10.32.10.1;

2、连接路由器的console口与PC机的COM1,使用PC的超级终

端软件访问路由器,将路由器的地址设为10.32.10.32(与计算机的IP

地址同网段即可)。建议在进行IOS升级前将原有IOS文件备份下来,防

止待升级的IOS文件存在问题不可用;

QUOTE:Router# dir flash: (查看目前IOS映象文件

名,也可用Router#Show version)

Directory of flash:/

1 -rw- 5998292 C

8388608 bytes total (2390252 bytes free)

Router#copy flash tftp (备份IOS

文件)

Source filename []?

Address or name of remote host []? 10.32.10.1 (TFTP

服务器地址)

Destination filename []?

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

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

5998292 bytes copied in 324.071 secs (18509 bytes/sec)

Router# 3、对路由器进行IOS升级;

QUOTE:Router#copy tftp flash

Address or name of remote host []?

10.32.10.1 (TFTP服务器地址)

Source filename []?

(需升级的新IOS映象文件

名)

Destination filename []?

Do you want to over write? [confirm]

Accessing tftp://10.32.10.1/……

Erase flash: before copying? [confirm]

Erasing the flash filesystem will remove all files!

Continue? [confirm]

Erasing device……

eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ……erasedee

Erase of flash: complete

Loading from 10.32.10.1 (via

Ethernet0/0):

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

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

[OK - 5998292 bytes]

Verifying checksum…… OK (0xA0C0)

5998292 bytes copied in 318.282 secs (18846 bytes/sec)

Router# IOS升级方法二

由于升级失败后或者路由器的config-register寄存器值为

0x2101时,开启路由器时、或者在开启(某些型号)Cisco路由器的电源

开关后30秒内按下Ctrl+break键,中断路由器的正常启动,路由器都会

进入rom监视模式,即Router(boot)>,在这种情形下,对路由器的IOS

进行升级,也比较简单。首先进入特权模式下,即

QUOTE:Router(boot)>en

Router(boot)#其他升级步骤同方法一,即:执行copy tftp flash

命令,对IOS进行升级。升级完成后,不要忘了修改config-register

寄存器值为0x2102(恢复正常值)。

QUOTE:Router(boot)# t

Router(boot)( config)# config-register 0x2102

Router(boot)( config)#exit

Router(boot)#wr

Router(boot)#reload重启即可。

[回复] [引用]

引用地址:

/u8915517/ [复制链接]

就想随便逛逛 发表于:2006-3-16 14:42:10

第2楼

IOS升级方法三

由于不小心使用了命令erase flash或升级失败后或在

开启(某些型号)Cisco路由器的电源开关后30秒内按下

Ctrl+break键,中断路由器的正常启动,路由器都会进入rom

监视模式,即 rommon 1>,在这种情形下,对路由器的IOS进

行升级,情况要稍微复杂一点。在rommon 1>状态下,可键?请

求帮助。(1为命令行序号,每执行1条命令自动加1)

08915517

QUOTE:rommon 1 > ?

alias set and

display aliases command

boot boot up an

external process

break set/show/clea

r the breakpoint

confreg configuration

register utility

cont continue

executing a downloaded image

context display the

context of a loaded image

cookie

contents of cookie PROM in hex

dev

device table

dir

in file system

dis

instruction stream

dnld

download a program module

frame

selected stack frame

help

builtin command help

history

history

meminfo

information

repeat

monitor command

reset

set

monitor variables

display

list the

list files

display

serial

print out a

monitor

repeat a

system reset

display the

monitor command

main memory

stack produce a

stack trace

sync write monitor

environment to NVRAM

sysret print out info

from last system return

tftpdnld tftp image

download

unalias unset an alias

unset unset a

monitor variable

xmodem x/ymodem image

download

rommon 2 >在rommon 1>状态下有两种升级IOS方法。

(一)、通过Xmodem命令(注:Xmodem与实际的modem

没有任何联系 只是一个传输协议数据是通过终端的串口和路

由器的Console口灌进去的)升级IOS,具体步骤如下:

1、用Cisco原配的线缆连接路由器的console口与PC

机的COM1,使用PC机的超级终端软件访问路由器,这时不需要

对PC和路由器配置任何地址。

2、在这个模式下,输入Xmodem命令,即:

QUOTE:rommon 2 > xmodem -c

(-c是带校验,为存放在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 …… (此

时在超级终端的传送栏目=> 选择发送文件选项 => 再选择

Xmodem 并指明IOS映像文件所在的路径,按发送即开始上传

IOS,等待时间很长,视IOS的大小和传输速度。)

QUOTE:Erasing flash at 0x607c0000

program flash location 0x605b0000

Download Complete!

传完以后,对整个系统初始化 显示如下:

QUOTE:program load complete, entry point:

0x80008000, size: 0x5b85e0

Self decompressing the image :

[OK]

Smart Init is disabled. IOMEM set to: 10

Using iomem percentage: 10

Restricted Rights Legend

Use, duplication, or disclosure by the Government

is

subject to restrictions as set forth in

subparagraph

(c) of the Commercial Computer Software -

Restricted

Rights clause at FAR sec. 52.227-19 and

subparagraph

(c) (1) (ii) of the Rights in Technical Data

and Computer

Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc.

170 West Tasman Drive

San Jose, California 95134-1706

Cisco Internetwork Operating System Software

IOS (tm) C2600 Software (C2600-I-M), Version

12.2(11)T9, RELEASE SOFTWARE (fc1)

TAC Support:

/tac

Copyright (c) 1986-2003 by cisco Systems, Inc.

Compiled Mon 23-Jun-03 15:42 by cmong

Image text-base: 0x8000809C, data-base:

0x80A68B48

cisco 2610 (MPC860) processor (revision 0x203)

with 22528K/2048K bytes of memory

Processor board ID JAD03483395 (1128032249)

M860 processor: part number 0, mask 49

Bridging software.

X.25 software, Version 3.0.0.

1 Ethernet/IEEE 802.3 interface(s)

2 Serial(sync/async) network interface(s)

32K bytes of non-volatile configuration memory.

8192K bytes of processor board System flash

(Read/Write)

Press RETURN to get started!

*Mar 1 00:00:05.652: %PA-2-UNDEFPA: Undefined

Port Adaptor type 100 in bay 1

*Mar 1 00:00:07.996: %LINK-3-UPDOWN: Interface

Ethernet0/0, changed state to up

*Mar 1 00:00:07.996: %LINK-3-UPDOWN: Interface

Serial0/0, changed state to down

*Mar 1 00:00:07.996: %LINK-3-UPDOWN: Interface

Serial0/1, changed state to down

*Mar 1 00:00:09.142: %LINEPROTO-5-UPDOWN: Line

protocol on Interface Ethernet0/0, changed state to up

*Mar 1 00:00:09.142: %LINEPROTO-5-UPDOWN: Line

protocol on Interface Serial0/0, changed state to down

*Mar 1 00:00:09.142: %LINEPROTO-5-UPDOWN: Line

protocol on Interface Serial0/1, changed state to down

*Mar 1 00:00:09.458: %SYS-5-CONFIG_I:

Configured from memory by console

*Mar 1 00:00:11.245: %LINK-5-CHANGED:

Interface Serial0/1, changed state to administratively

down

*Mar 1 00:00:12.275: %SYS-5-RESTART: System

restarted ——Cisco Internetwork Operating System

Software

IOS (tm) C2600 Software (C2600-I-M), Version

12.2(11)T9, RELEASE SOFTWARE (fc1)

TAC Support:

/tac

Copyright (c) 1986-2003 by cisco Systems, Inc.

Compiled Mon 23-Jun-03 15:42 by cmong

*Mar 1 00:00:12.279: %SNMP-5-COLDSTART: SNMP

agent on host NE16 is undergoing a cold start

Router>采用这种方法时,由于使用console口来传送,

速率为9600bps,需要时间较长。因此可修改console口速率利

用xmodem命令实现快速升级IOS.具体方法如下:

QUOTE: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 bcast 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 commands

or 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

rommon 2 > reset 回车注意:在按reset键前,需要

修改串口速度(我的电脑——端口属性——串口速度调为

115200),然后再修改超级终端里设置速率为115200,记住,

一定要这么做,否则会出现乱码!然后关闭这个超级终端,重

新建立一个超级终端连接,重新启动系统后,出现

QUOTE:rommon 1> 提示符然后,输入

QUOTE: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.

方法如下:

QUOTE: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 = 0x80004684

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 bcast 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

然后敲入

QUOTE:rommon 2 >reset最好关掉电源后,重新启动。

利用xmodem命令实现路由器IOS升级速度较慢,往往等上很长

时间,为了快速升级,可以采用下列方法。

就想随便逛逛 发表于:2006-3-16 14:42:51

第3楼

08915

517

(二)通过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、通过set 命令查看配置参数

QUOTE:rommon 2 > set

PS1=rommon ! >

BOOT=

BSI=0

RET_2_RTS=

?=0 4、在 rommon 状态下输入:(注意大小写)

QUOTE: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=

(上传ios文件的名称)

rommon

8>sync

(保存参数配置)

rommon

9 >set

(查看)

rommon 10 > set

PS1=rommon ! >

BOOT=

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=

BSI=0

RET_2_RTS=

?=0

rommon 11 >tftpdnld执行tftpdnld命令进行ios升级,

有时可能会报错或命令不执行,这时只要用sync命令保存配置后,

重新启动路由器(最好关掉电源再开机)后,再执行tftpdnld命

令就可以了。

QUOTE:rommon 11 >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:

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 from

10.32.10.32!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

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

File reception completed.

Copying file to flash.

Erasing flash at 0x607c0000

program flash location 0x605b0000

rommon 13 >

在rommon 13 >提示符下键入reset,或重新启动路由器

(power-cycle),进入正常引导状态,即:

Router>笔者在Cisco2500、2600、7200等系列路由器上均

实际操作过,以上为在Cisco2610路由器上实际操作捕获或截屏,

所配地址只是特例,大家可根据实际需要予以修改。最后建议:大

家在作正常路由器系统升级时,为防止不正确操作等引起的升级失

败,请先把路由器原有的系统备份下来。

思科IOS指南: 如何升级路由器和交换机

ZDNet软件频道 时间:2009-12-05 作者: | 比特网 我要评论()

本文关键词:路由器 交换机 思科

如果你是网络管理员,一定对于Windows系统的升级非常熟悉。一般情况下Windows每月都会公布安

全漏洞以及给出相应的升级补丁。但是这并不代表你的网络里只有Windows系统需要定期进行升级和打补

丁:对于Cisco路由器和交换机,一样要定期进行系统升级。

如果你是网络管理员,一定对于Windows系统的升级非常熟悉。一般情况下Windows

每月都会公布安全漏洞以及给出相应的升级补丁。但是这并不代表你的网络里只有

Windows系统需要定期进行升级和打补丁:对于Cisco路由器和交换机,一样要定期进行

系统升级。

除非你的公司里,有专职的网络管理团队,否则对于路由器和交换机的升级工作通常都

会排在工作列表的最下面,而工作列表的最上面一般都是Windows系统升级和打补丁的任

务。当然,由于Windows系统与Cisco设备相比,存在更多的漏洞,因此更优先考虑Windows

系统升级并没有错误。

不过,在你的工作列表中,对路由器和交换机系统的升级工作不应该放在最不重要的位

置。而判断这种工作优先程度的因素很多,主要包括以下三种:

· 为严重漏洞打补丁: 和其它网络设备或应用程序一样,Cisco路由器和交换机也会

存在安全漏洞。同时,由于路由器和交换机都属于网络架构中的重要组成部分,因此必须立

即将其存在的安全漏洞修补好。

· 增加新功能: 除非只是针对bug的修补,否则大部分新版本的Cisco IOS都会包含一

些新功能。定期更新路由器和交换机系统,意味着你可以通过新增加的功能让自己的工作变

得更轻松。

· 保持最新版本: “保持版本最新”也许是听上去最站不住脚的更新理由。当时,如果你

的路由器IOS需要与多种不同的工具进行交互工作,那么保持最新版本就变得相当重要了。

比如,如果你在使用SNMP网络管理工具,那么你就必须确保路由器采用了合适版本的IOS。

一旦你认可了应该对路由器和交换机进行升级,接下来该做的是什么呢?也许你已经很

久没有升级过路由器了,也许你从来就没有这样做过,那么你肯定需要一些指导了。为了帮

助大家顺利进行升级,我会一步步带领大家对Cisco IOS进行升级操作(本文中我们针对的

是路由器,交换机的升级方法与之类似)。

盘 点

首先,对于网络中的每一个路由器和交换机,你都要知道他们的型号,RAM大小, Flash

闪存大小,以及当前安装的IOS版本。通过show version 命令,以上各项都可以被查询到。

Router# show version

Cisco Internetwork Operating System Software

IOS (tm) 2500 Software (C2500-IS-L), Version 12.3(12), RELEASE SOFTWARE

(fc3)

Technical Support: /techsupport

Copyright (c) 1986-2004 by Cisco Systems, Inc.

Compiled Tue 30-Nov-04 02:33 by kellythw

Image text-base: 0x03094EA4, data-base: 0x00001000

ROM: System Bootstrap, Version 11.0(10c)XB1, PLATFORM SPECIFIC RELEASE

SOFTWARE (fc1)

BOOTLDR: 3000 Bootstrap Software (IGS-BOOT-R), Version 11.0(10c)XB1,

PLATFORM SPECIFIC RELEASE SOFTWARE (fc1)

ccie-termserver uptime is 1 week, 5 days, 2 hours, 17 minutes

System returned to ROM by power-on

System restarted at 13:55:11 CDT Wed Apr 20 2005

System image file is "flash:/"

Cisco AS2511-RJ (68030) processor (revision K) with 14336K/2048K bytes of

memory.

Processor board ID 22798335, with hardware revision 00000000

Bridging software.

X.25 software, Version 3.0.0.

1 Ethernet/IEEE 802.3 interface(s)

1 Serial network interface(s)

16 terminal line(s)

32K bytes of non-volatile configuration memory.

16384K bytes of processor board System flash (Read ONLY)

Configuration register is 0x2102

Router#

从上面的例子中,我们可以看到路由器型号是Cisco 2511 , IOS版本 12.3(12),内存

16 MB (14,336K + 2,048K),Flash闪存 16 MB。

在选择将要升级的IOS镜像时,以上信息是重要的选择依据。我建议大家将这些信息

写入一个表格中保持。这样当我们下次在对这台路由器进行升级时,就可以不必重复查询设

备信息,从而节省了升级时间。

-------------------------------分页栏-------------------------------

查找合适的IOS镜像

接下来,就是通过上面查询到的信息搜索合适的 IOS镜像版本了。记住一定要从Cisco

Systems官方获取IOS镜像,同时必须有官方维护机构的联系方式。

实际上,如果不输入用户名和密码,你都无法访问 Cisco的软件下载中心。 由于这种

原因,我在接下来的讲解中都会带有相应的网站截图,方便大家学习。图 A 显示了用户登

录软件中心后的网页界面。

图 A

点击 Cisco IOS Software 链接可以进入 Cisco IOS Software页面,如图 B.所示。然

后点击你想要升级到的 Cisco IOS软件名称。这里列出的一般都是最新版本,不过如果你

的路由器内存或Flash闪存太小,可能只能使用较早版本的IOS了。

图 B

-------------------------------分页栏-------------------------------

在本例中,我选择了 IOS 12.3(虽然最新版本是12.4,不过12.3也算是相当新的了)。

点击版本链接后,浏览器会进入到版本详细数据页面,其中包含了版本信息,硬件兼容列表,

bug列表以及其它信息,如图c所示。

图 C

接下来点击链接进行下载,同时你会看到IOS Upgrade Planner,如图d所示。由于升

级 Cisco IOS是一个复杂的过程,因此Cisco通过IOS Upgrade Planner来帮助用户选择

正确的IOS版本。用户只需要填入设备的型号,内存大小,Flash闪存大小以及需求即可。

图 D

在使用Cisco IOS Upgrade Planner时,你必须选择三个选项:平台,版本以及软件功

能组。记住,不是每种路由器都可以安装所有的版本和所有的功能组的,而且经常会出现你

所使用的路由器不支持你所希望的功能组的情况。因此通常情况下,你需要根据你所希望拥

有的功能组,来选择某一版本的IOS(不一定是最新版本),以便能让这个功能组在你的路由

器上正常工作。

另外,一定要输入正确的版本号,以确保你所下载的是稳定版的IOS。Cisco IOS的版

本有多种,其区别如下:

· GD — 常规部署版本,属于最稳定的版本。

· ED — 早期开发版本,意味着会存在较多的bug。

· LD – 限制版

· DF — 延期版

对于我们的网络设备,一般都应该安装GD 版本,这也是包含了最多补丁的最新版本。

在本例中,我的老式2511路由器希望从现有的12.3(12)版本进行升级。首先我会在Cisco

IOS Upgrade Planner中选择路由器平台(2501-2525) ,然后选择IP PLUS功能组。之后

系统会将我的可选择范围限制在少数几个IOS版本中,如图e所示。

图 E

接下来我会从中选择一个较新的版本:12.3.13a (LD)。(出于举例的原因,我没有按照

常规选择GD版本)。接下来的页面非常重要,它包含了所选IOS版本的系统需求情况,如

图f所示。

图 F

我们注意到,这个版本的IOS需要路由器设备具备16 MB内存和16 MB闪存。因此在

进行下一步操作前,我们要回过头检查一下设备的信息,看是否符合IOS的需求。随着时

间的推移,新版IOS的体积会逐渐增大,这就要求我们对老款路由设备进行内存和闪存升

级,以便能安装新版的IOS。

在本例中,我很幸运,不需要升级路由器内存和闪存就可以安装新版IOS。如果你没那

么幸运,必须升级才能安装所选版本,那么可以尝试回过头选择一个不同的功能组(比如选

择IP ONLY而不是IP PLUS),这样的功能组对内存和闪存的需求会低一些。或者可以回过

头选择一个体积较小的IOS版本。

点击 I Agree 按钮并同意终端用户许可协议 (EULA) 后就可以下载升级版的IOS镜像

了。如图g所示。.

图 G

点击下载链接后 ,系统会询问要将文件保存在什么位置。一般我都会保存在C:盘。

测试新版IOS

如果你的网络很小,或者你只有一两个路由器需要升级,那么就不必进行什么测试了。

相反,对于中型网络环境,新版IOS的测试环节很重要。测试过程如下:

1. 在备用路由器上测试所下载的IOS

2. 测试完毕后,考虑如何将其部署到远程路由器上。因为你已经知道了IOS的系统需

求,因此应该首先考虑是不是所有的待升级路由器都符合IOS对于内存和闪存的需求。别

忘了硬件升级会大大增加升级IOS所需的时间。

3. 一次升级一个路由器,并且将升级时间安排在非工作时间(包括将升级文件下载到路

由器上的工作)。如果你没有足够的带宽,最好将新版IOS刻录在CD中,并在路由器所在

的本地PC上操作,或者将IOS拷贝到PCMCIA卡上,并将其插入路由器的相应插槽内(如

3600系列路由器)。

正式开始升级

有了IOS,我们在升级前需要通过TFTP服务器将IOS镜像下载到路由器中。我倾向

于采用不需要安装的小型TFTP服务器软件,大家可以在网上免费下载这个

软件。采用别的TFTP服务器也可以,另外,大家甚至可以用另一台Cisco路由器作为TFTP

服务器。

在路由器和TFTP服务器间用PING进行连接测试。然后使用copy tftp flash 命令将新

的IOS镜像拷贝到路由器上。(需要输入TFTP服务器的IP地址或服务器名)。

另外在拷贝前系统还会询问是否要擦除现有的Flash闪存。一般在IOS升级时,我们

都会选择擦除现有Flash闪存中的内容。下面是一个操作范例:

Router# copy tftp flash

Address or name of remote host []? 10.253.1.1

Source filename []?

Destination filename []?

Accessing tftp://10.253.1.1/...

Erase flash: before copying? [confirm] yes

eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased

Loading from 10.253.1.1 (via Serial0/0.1):

OK (0xA6B7)

931088 bytes copied in 205.461 secs (4532 bytes/sec)

Router#

[注: 我故意裁小了IOS文件尺寸,以便缩短拷贝时间]

重启路由器

这是IOS升级过程的最后一步。如果你是在非工作时间进行升级的,那么在升级后可

以立即重新启动路由器,查看更新后的系统能否正常工作。

而如果你是在工作时间对路由器进行升级的,那么可以等到下班后再重启路由器。另外,

我们可以通过路由器命令reload at 设定自动重启时间。

重启后,应该双击每一项功能,检查路由器与重要主机间的通信,查看配置文件是否还

保留有你先前的配置内容。一般情况下,重大的升级可能会导致一些功能的丢失或者配置文

件被重置。

CISCO路由器IOS升级方法总结(二)

作者: 网络转载 发布日期: 无

IOS升级方法三

由于不小心使用了命令erase flash或升级失败后或在开启(某些型号)

Cisco路由器的电源开关后30秒内按下Ctrl+break键,中断路由器的正常启动,

路由器都会进入rom监视模式,即 rommon 1>,在这种情形下,对路由器的IOS

进行升级,情况要稍微复杂一点。在rommon 1>状态下,可键?请求帮助。(1

为命令行序号,每执行1条命令自动加1)

QUOTE:rommon 1 > ?

alias set and display aliases

command

boot boot up an external process

break set/show/clear the

breakpoint

confreg configuration register utility

cont continue executing a

downloaded image

context

image

cookie

PROM in hex

dev

dir

dis

dnld

module

frame

frame

help

help

history

meminfo

repeat

reset

set

variables

stack

sync

to NVRAM

the context of a loaded

display contents of cookie

list the device table

list files in file system

display instruction stream

serial download a program

print out a selected stack

monitor builtin command

repeat a monitor command

system reset

display the monitor

produce a stack trace

write monitor environment

display

monitor command history

main memory information

sysret print out info from last

system return

tftpdnld tftp image download

unalias unset an alias

unset unset a monitor variable

xmodem x/ymodem image download

rommon 2 >在rommon 1>状态下有两种升级IOS方法。

(一)、通过Xmodem命令(注:Xmodem与实际的modem没有任何联系 只

是一个传输协议 数据是通过终端的串口和路由器的Console口灌进去的)升级

IOS,具体步骤如下:

1、用Cisco原配的线缆连接路由器的console口与PC机的COM1,使

用PC机的超级终端软件访问路由器,这时不需要对PC和路由器配置任何地址。

2、在这个模式下,输入Xmodem命令,即:

QUOTE:rommon 2 > xmodem -c

(-c是带校验,为存放在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

…… (此时在超级终端的传送栏目=> 选

择发送文件选项 => 再选择Xmodem 并指明IOS映像文件所在的路径,按发送即

开始上传IOS,等待时间很长,视IOS的大小和传输速度。)

QUOTE:Erasing flash at 0x607c0000

program flash location 0x605b0000

Download Complete!

传完以后,对整个系统初始化 显示如下:

QUOTE:program load complete, entry point: 0x80008000, size:

0x5b85e0

Self decompressing the image :

[OK]

Smart Init is disabled. IOMEM set to: 10

Using iomem percentage: 10

Restricted Rights Legend

Use, duplication, or disclosure by the Government is

subject to restrictions as set forth in subparagraph

(c) of the Commercial Computer Software - Restricted

Rights clause at FAR sec. 52.227-19 and subparagraph

(c) (1) (ii) of the Rights in Technical Data and Computer

Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc.

170 West Tasman Drive

San Jose, California 95134-1706

Cisco Internetwork Operating System Software

IOS (tm) C2600 Software (C2600-I-M), Version 12.2(11)

T9, RELEASE SOFTWARE (fc1)

TAC Support: /tac

Copyright (c) 1986-2003 by cisco Systems, Inc.

Compiled Mon 23-Jun-03 15:42 by cmong

Image text-base: 0x8000809C, data-base: 0x80A68B48

cisco 2610 (MPC860) processor (revision 0x203) with

22528K/2048K bytes of memory

Processor board ID JAD03483395 (1128032249)

M860 processor: part number 0, mask 49

Bridging software.

X.25 software, Version 3.0.0.

1 Ethernet/IEEE 802.3 interface(s)

2 Serial(sync/async) network interface(s)

32K bytes of non-volatile configuration memory.

8192K bytes of processor board System flash (Read/Write)

Press RETURN to get started!

*Mar 1 00:00:05.652: %PA-2-UNDEFPA: Undefined Port Adaptor

type 100 in bay 1

*Mar 1 00:00:07.996: %LINK-3-UPDOWN: Interface Ethernet0/0,

changed state to up

*Mar 1 00:00:07.996: %LINK-3-UPDOWN: Interface Serial0/0,

changed state to down

*Mar 1 00:00:07.996: %LINK-3-UPDOWN: Interface Serial0/1,

changed state to down

*Mar 1 00:00:09.142: %LINEPROTO-5-UPDOWN: Line protocol

on Interface Ethernet0/0, changed state to up

*Mar 1 00:00:09.142: %LINEPROTO-5-UPDOWN: Line protocol

on Interface Serial0/0, changed state to down

*Mar 1 00:00:09.142: %LINEPROTO-5-UPDOWN: Line protocol

on Interface Serial0/1, changed state to down

*Mar 1 00:00:09.458: %SYS-5-CONFIG_I: Configured from

memory by console

*Mar 1 00:00:11.245: %LINK-5-CHANGED: Interface Serial0/1,

changed state to administratively down

*Mar 1 00:00:12.275: %SYS-5-RESTART: System restarted

——Cisco Internetwork Operating System Software

IOS (tm) C2600 Software (C2600-I-M), Version 12.2(11)

T9, RELEASE SOFTWARE (fc1)

TAC Support: /tac

Copyright (c) 1986-2003 by cisco Systems, Inc.

Compiled Mon 23-Jun-03 15:42 by cmong

*Mar 1 00:00:12.279: %SNMP-5-COLDSTART: SNMP agent on host

NE16 is undergoing a cold start

Router>采用这种方法时,由于使用console口来传送,速率为9600bps,

需要时间较长。因此可修改console口速率利用xmodem命令实现快速升级IOS.

具体方法如下:

QUOTE: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 bcast 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 commands

or 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

rommon 2 > reset 回车注意:在按reset键前,需要修改串口速度(我

的电脑——端口属性——串口速度调为115200),然后再修改超级终端里设置

速率为115200,记住,一定要这么做,否则会出现乱码! 然后关闭这个超级终

端,重新建立一个超级终端连接,重新启动系统后,出现

QUOTE:rommon 1> 提示符然后,输入

QUOTE: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.

方法如下:

QUOTE: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 = 0x80004684

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 bcast address"? y/n [n]: n (选择 no)

disable "load rom after netboot fails"? y/n [n]: n (选择 no)