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             C2600-I-MZ.122-11.BIN

8388608 bytes total (2390252 bytes free)

Router#copy flash tftp          (备份IOS文件)

Source filename []?c2600-i-mz.122-11.bin

Address or name of remote host []? 10.32.10.1 (TFTP服务器地址)

Destination filename [c2600-i-mz.122-11.bin]?

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

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

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 []? c2600-i-mz.122-11.bin       (需升级的新IOS映象文件名)

Destination filename [c2600-i-mz.122-11.bin]?

Do you want to over write? [confirm]

Accessing tftp://10.32.10.1/c2600-i-mz.122-11.bin...

Erase flash: before copying? [confirm]

Erasing the flash filesystem will remove all files! Continue? [confirm]

Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erasedee

Erase of flash: complete

Loading c2600-i-mz.122-11.bin 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   
重启即可。
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          display the context of a loaded image

cookie              display contents of cookie PROM in hex

dev                 list the device table

dir                 list files in file system

dis                 display instruction stream

dnld             serial download a program module

frame             print out a selected stack frame

help             monitor builtin command help

history          monitor command history

meminfo          main memory information

repeat              repeat a monitor command

reset             system reset

set                 display the monitor variables

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 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的大小和传输速度。)

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: http://www.cisco.com/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: http://www.cisco.com/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升级速度较慢,往往等上很长时间,为了快速升级,可以采用下列方法。
二)通过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=C2600-I-MZ.122-11.BIN (上传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=C2600-I-MZ.122-11.BIN

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: 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.32!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

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

File reception completed.

Copying file C2600-I-MZ.122-11.BIN to flash.

Erasing flash at 0x607c0000

program flash location 0x605b0000

rommon 13 >

在rommon 13 >提示符下键入reset,或重新启动路由器(power-cycle),进入正常引导状态,即:

Router>
笔者在Cisco2500、2600、7200等系列路由器上均实际操作过,以上为在Cisco2610路由器上实际操作捕获或截屏,所配地址只是特例,大家可根据实际需要予以修改。最后建议:大家在作正常路由器系统升级时,为防止不正确操作等引起的升级失败,请先把路由器原有的系统备份下来。

实验8:路由器IOS升级2的更多相关文章

  1. 实验6:路由器IOS升级

    路由器IOS升级 Cisco路由器IOS映像恢复及升级方法 一.Cisco 1000,1600,2500,4000系列 1.IOS映像恢复的方法及步骤 1) 连接PC的COM1口与路由器的consol ...

  2. 实验7:交换机IOS升级

    交换机IOS升级首先需要有IOS文件,如果没有备份原文件的话,可以找个同一版本的IOS来替代. 第一种方法:X-Modem 以前我曾经尝试过一种方法,就是当Flash被删除后,启动无法进入系统,可以用 ...

  3. cisco ASA ios升级或恢复

    cisco ASA ios升级或恢复 一.升级前准备工作 1.准备好所要升级的IOS文件及对应的ASDM文件 2.在一台电脑上架设好tftp,设置好目录,与防火墙进行连接(假设电脑IP为192.168 ...

  4. iOS 升级HTTPS通过ATS你所要知道的

    由于苹果规定2017年1月1日以后,所有APP都要使用HTTPS进行网络请求,否则无法上架,因此研究了一下在iOS中使用HTTPS请求的实现.网上搜索了一些比较有用资料,大家可以参考下 苹果强制升级的 ...

  5. iOS升级HTTPS通过ATS你所要知道的

    由于苹果规定2017年1月1日以后,所有APP都要使用HTTPS进行网络请求,否则无法上架,因此研究了一下在iOS中使用HTTPS请求的实现.网上搜索了一些比较有用资料,大家可以参考下 苹果强制升级的 ...

  6. cordova ios升级插件

    org.ssgroup.sope.cordova.upgrade 支持强制升级与选择升级 插件已经开源在https://github.com/shenshouer/org.ssgroup.sope.c ...

  7. cisco网络设备IOS升级步骤

    step1:检查和备份================================================================4507R#write4507R#copy run ...

  8. ios升级<注:来着微信平台>

    <来着微信平台>  http://mp.weixin.qq.com/s?__biz=MjM5NTIyNTUyMQ==&mid=2709545194&idx=1&sn ...

  9. 待实验:Android 增量升级

    参考资料: 增量升级(省流量更新)的Android客户端实现  http://blog.csdn.net/sgwhp/article/details/9009427 http://my.oschina ...

随机推荐

  1. 分表分库解决方案(mycat,tidb,shardingjdbc)

    公司最近有分表分库的需求,所以整理一下分表分库的解决方案以及相关问题. 1.sharding-jdbc(sharding-sphere) 优点: 1.可适用于任何基于java的ORM框架,如:JPA. ...

  2. cocos2dx Geometry Size和Rect

    Size 代码都是基础代码不注释了,写一些特别的 1.赋值时可以接收Size和Vec2类型的值,保证的类型的兼容性 2.对运算符进行了重载,可以按照正常的数学逻辑运算 3..可以使用equals对比大 ...

  3. < python音频库:Windows下pydub安装配置、过程出现的问题及常用API >

    < python音频库:Windows下pydub安装配置.过程出现的问题及常用API > 背景 刚从B站上看过倒放挑战之后也想体验下,心血来潮一个晚上完成了基本的实现.其中倒放与播放部分 ...

  4. Shell one

    1.shell的运算符包括:算术运算符.关系运算符.布尔运算符.字符串运算符.文件测试运算符 1.1原生bash不支持简单的数学运算,但是可以通过其他命令来实现,例如 awk 和 expr,expr ...

  5. HDU3886 Final Kichiku “Lanlanshu” 题解 数位DP

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3886 题目大意: 给一定区间 \([A,B]\) ,一串由 /, \ , - 组成的符号串.求满足符号 ...

  6. 洛谷P2657 [SCOI2009]windy数 题解 数位DP

    题目链接:https://www.luogu.com.cn/problem/P2657 题目大意:找区间 \([A,B]\) 范围内 不含前导零 且 相邻两个数字之差至少为2 的正整数的个数. 题目分 ...

  7. react根据传参的不同动态注册不同的子组件

    上一篇文章介绍了关于Vue如何根据传参的不同动态注册不同的子组件,实现过程请查阅Vue.extend动态注册子组件,由Vue的这个功能我就自然联想到了使用react该如何实现同样的功能呢.其实,用re ...

  8. redis最新版本安装及开机自启

    的系统是ubuntu,安装方式有多种,一种是通过apt仓库,一种是下载源码,编译安装 1.通过apt仓库 具体命令: sudo apt-get update sudo apt-get install ...

  9. 一个简易的 LED 数字时钟实现方法

    这个应该是已经有很多人做过的东西,我应该只是算手痒,想写一下,所以,花了点时间折腾了这个,顺便把 Dark Mode 的处理也加上了. 首先可以很明确的一点,这个真没技术含量存在,只是需要点耐心. L ...

  10. P1640 [SCOI2010]连续攻击游戏 二分图最大匹配 匈牙利算法

    题目描述 lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1,10000]之间的数表示.当他使用某种装备时,他只能使用该装备的某一个属性.并且每种装备 ...