Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1292403
  • 博文数量: 464
  • 博客积分: 9399
  • 博客等级: 中将
  • 技术积分: 6364
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-19 09:15
文章分类

全部博文(464)

文章存档

2014年(12)

2013年(123)

2012年(173)

2011年(156)

我的朋友

分类: 系统运维

2011-06-07 16:19:45

Cisco路由器IOS映像恢复及升级方法
    笔者从事江西省移动通信公司BOSS(Business Operator Support System,业务运营支撑系统TCP/IP网络日常维护和管理工作近3年,对Cisco路由器的操作、维护和管理有一定的经验,并在数年的实践过程中总结出一套关于Cisco路由器IOS映像恢复及升级的方法,现执笔成文,以飨读者。
由于历史原因,Cisco公司的路由器产品丰富且繁杂,Cisco路由器的专用操作系统IOS映像也同时存在多个版本,以下就分别针对两类加载不同版本的IOS映像文件的Cisco路由器做讨论。
  一、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? igs-i-l.110-22a.bin(IOS映像文件名)
  Destination file name [igs-i-l.110-22a.bin]?
  Accessing file 'igs-i-l.110-22a.bin' on 192.168.18.168...
  Loading igs-i-l.110-22a.bin from 192.168.18.168 (via Ethernet0): ! [OK]
  Device needs erasure before copying new file
  Erase flash device before writing? [confirm]
  Copy 'igs-i-l.110-22a.bin' from server
  as 'igs-i-l.110-22a.bin' into Flash WITH erase? [yes/no]y
  Erasing device... eeeeeeeeeeeeeeee ...erased
  Loading igs-i-l.110-22a.bin 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 c3640-i-mz.120-10.bin(IOS映像文件名)
  4) 然后,路由器一直等待从PC上接收该IOS映像文件,此时在超级终端软件中点击发送选项,选择存放在PC本地硬盘中的IOS映像文件,确定后即开始下载文件至路由器的flash memory中,由于通讯带宽只有9600波特,整个文件下载时间约为1.5小时(依文件大小而定),屏幕显示信息如下:
  Do not start the sending program yet...
  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 c3640-i-mz.120-10.bin ...
  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

       

阅读(702) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~