"本文解释如何使用普通文件传输协议(TFTP) 服务器或远程复制协议(RCP)服务器应用程序将Cisco IOS®软件安装到安装""从闪存运行的"" Cisco路由器上。"本示例基于Cisco 1600系列路由器,但适用于“已使用组件”部分中提及的所有平台。
注意:本文档中的信息基于Cisco IOS软件版本12.1及更高版本。
本文档没有任何特定的要求。
本文档中的信息基于以下软件和硬件版本:
Cisco 1600 系列路由器
Cisco 2000 系列路由器
Cisco 2500 系列路由器
Cisco 3000 系列路由器
思科AS5100系列接入服务器
思科AS5200系列接入服务器
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
Cisco建议在升级Cisco IOS软件映像之前保留路由器/接入服务器配置的备份。
TFTP服务器或RCP服务器应用必须安装在TCP/IP就绪工作站或PC上。安装应用后,必须完成以下步骤来执行最低级别的配置:
配置 TFTP 应用程序使其作为 TFTP 服务器运行,而不是作为 TFTP 客户端。
指定出站文件目录。这是存储Cisco IOS软件映像的目录(请参见第2步)。 大多数TFTP应用程序提供安装例程序辅助这些配置任务。
注意: 一定数量的TFTP或RCP应用程序可以从独立软件供应商获得,或者作为共享软件从万维网的公共源获得。
从软件下载区将 Cisco IOS 软件镜像下载到您的工作站或 PC 上。
确保您下载的Cisco IOS软件映像同时支持您的硬件和所需的功能。您可以使用Cisco Software Advisor工具(仅限注册客户)验证硬件和功能支持。 您还必须检查动态RAM(DRAM)和闪存的内存要求,以确保路由器具有足够的DRAM和闪存来加载所选的Cisco IOS软件版本。有关为路由器选择正确的Cisco IOS软件版本的更多建议,请参阅如何选择Cisco IOS软件版本。
要从闪存安装运行,请完成以下步骤:
注意:对于RCP应用,请用RCP代替每次出现的TFTP。例如,用 copy rcp flash 命令代替 copy tftp flash 命令。
建立一个控制台会话到路由器。
即使可以通过Telnet会话连接路由器,我们仍强烈建议通过控制台端口直接连接路由器。理由是:如果在升级期间发生了某些故障,则可能需要在离路由器近一点,以便对它进行重启。此外,在升级过程中路由器重新启动时,您将失去telnet连接。
使用反转电缆(通常浅黑电缆)将路由器的控制台端口连接到PC的COM端口上。
PC连接到路由器的控制台端口后,您需要在PC上打开超级终端,并使用以下设置:
Speed 9600 bits per second 8 databits 0 parity bits 1 stop bit No Flow Control
注意:如果您在超级终端会话中收到任何垃圾字符,这意味着您尚未正确设置超级终端属性,或者路由器的配置寄存器设置为控制台连接速度高于9600 bps的非标准值。使用show version命令(显示在最后一行)检查配置寄存器的值,并确保其设置为0x2102或0x102。必须重新加载路由器以考虑此更改。一旦您确定路由器端的控制台速率为9600 bps ,您则应检查超级终端的属性是否按上述显示设置的。有关设置超级终端属性的详细信息,请参阅为控制台连接应用正确的终端仿真器设置。
Booting Problems — 连接到路由器的控制台端口后,您可能会注意到路由器处于ROMmon或Boot模式。这两种模式用于恢复与诊断程序。如果您没有看到常见的路由器提示符,请使用这些建议以继续安装升级程序。
路由器在rommon模式下启动,当您发出dir flash:指令:
rommon 1 > dir flash: device does not contain a valid magic number dir: cannot open device "flash:" rommon 2 >
当您看到此错误消息时,这表示闪存为空或文件系统已损坏。有关如何对此问题进行故障排除的信息,请参阅使用ROMmon的Xmodem控制台下载过程。
路由器在引导模式下启动,控制台上显示以下消息:
router(boot)> device does not contain a valid magic number boot: cannot open "flash:" boot: cannot determine first file name on device "flash:"
当您在控制台输出中收到这些错误消息时,意味着闪存为空或文件系统已损坏。通过完成本文档中提供的步骤,在闪存上复制有效映像。
配置路由器或接入服务器以引导到Rxboot模式。
在这些平台上,Cisco IOS软件映像实际上直接从闪存运行。因此,如果您使用的是用户特权EXEC模式(Router #),您就不能从TFTP服务器将Cisco IOS软件镜像复制到闪存上。 从此输出中,您可以看到闪存在用户特权EXEC模式下为只读。
Router#show flash: PCMCIA flash directory: File Length Name/status 1 9615124 c1600-sy-l.122-7b.bin [9615188 bytes used, 7162024 available, 16777212 total] 16384K bytes of processor board PCMCIA flash (Read ONLY) Router#
您必须更改配置寄存器值,才能将路由器或接入服务器配置为引导到Rxboot模式。
检查配置寄存器的当前值。您可以在show version命令输出的最后一行中看到它。它通常设置为0x2102或0x102。稍后,您需要此值。
将配置寄存器更改为0x2101值。这将使路由器准备引导到RXboot模式:
Router>enable Password: ! --- Enter the password here. Router# Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#config-register 0x2101 Router(config)#^Z Router# %SYS-5-CONFIG_I: Configured from console by console !--- It is not necessary to save the configuration here, as the !--- configuration register has already been changed in NVRAM. Router#reload
注意:如果通过Telnet连接,则重新加载后会丢失会话。请稍候片刻并重试。强烈建议您不要远程执行Cisco IOS软件升级,因为大多数灾难恢复程序需要您在路由器实际安装的地方。
为下次重新加载恢复以前的配置寄存器值。
注意:当路由器处于引导模式时,请勿保存配置。请避免使用save命令(write memory或copy running-config startup-config),并对建议您保存当前配置的任何提示回答no。如果在路由器处于此模式时保存配置,则可以部分或完全擦除配置。
在以下命令中,将****替换为您在上一步中记录的配置寄存器值:
Router(boot)> Router(boot)>enable Password: Router(boot)#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(boot)(config)#config-register 0x**** Router(boot)(config)#^Z Router(boot)#
注意:如果您不记得之前设置的配置寄存器的值,则可以在此步骤中使用0x2102。
验证TFTP服务器到路由器的连通性。
TFTP 服务器和路由器之间必须有网络连接,且必须能 ping 出 TFTP 软件升级的目标路由器 IP 地址。要实现此目的,路由器接口和TFTP服务器必须具备:
同范围的IP地址,或者
配置了默认网关。
将新软件Cisco IOS软件映像从TFTP服务器复制到路由器或接入服务器。
现在您已经拥有IP连接性,并且能在充当TFTP服务器的计算机和路由器之间ping通,可以将Cisco IOS软件镜像复制到闪存中。
注意:在复制之前,请确保在PC上启动了TFTP服务器软件,并且TFTP服务器根目录中提到了文件名。思科建议在升级之前保留路由器或接入服务器配置的备份。升级本身不影响配置(存储在非易失性RAM(NVRAM)中)。 但是,如果没有正确执行操作步骤,则可能会产生影响。
对于RCP应用程序,将所出现的每一个TFTP替换为RCP。例如,用 copy rcp flash 命令代替 copy tftp flash 命令。
Router (boot)#copy tftp flash
指定 TFTP 服务器的 IP 地址。
出现提示时,输入TFTP服务器的IP地址,如以下示例所示:
Address or name of remote host [255.255.255.255]? 172.17.247.195
指定新思科 IOS 软件映像的文件名。
出现提示时,输入要安装的Cisco IOS软件映像的文件名,如以下示例所示:
Source file name? c1600-y-l.122-7b.bin
注意:文件名区分大小写,因此请确保输入正确。
指定目标镜像文件名。
这是新软件镜像加载至路由器时所具有的名称。镜像可以任意命名,但普遍做法是输入同一个镜像文件名。
Destination file name [c1600-y-l.112-18.P]? c1600-y-l.122-7b.bin
在回答是或否之前,请先清除闪存设备。
当您看到以下提示时:
Erase flash device before writing? [confirm] yes/no
输入yes 清除路由器闪存中现有的软件映像,然后再复制新软件映像。
输入no以保留现有软件映像。确认您有足够的内存来保存两者。
复制过程需要几分钟。时间因网络而异。在复制过程中,会显示一些消息,说明哪些文件已经被访问过。
感叹号(!)表示正在进行复制过程。每个感叹号(!)表示已成功传输十个数据包。镜像的校验和验证将在镜像写入闪存后执行。软件升级完成时,路由器或接入服务器必须重新加载新映像。
在重新加载之前,请验证映像安装。
确认镜像已正确安装在闪存上,同时boot system命令指向适当的文件开始下载。
要重新加载,请输入:
Router(boot)#reload *Mar 1 00:30:49.972: %SYS-5-CONFIG_I: Configured from console by console System configuration has been modified. Save? [yes/no]: NO Proceed with reload? [confirm] YES
验证路由器是否使用正确的映像运行。
在重新加载完成之后,路由器应运行所需的 Cisco IOS 软件映像。发出show version命令以验证升级。
Router >enable Password: Router#show version Cisco Internetwork Operating System Software IOS (tm) 1600 Software (C1600-NY-L), Version 12.0(9), RELEASE SOFTWARE (fc1) Copyright (c) 1986-2002 by cisco Systems, Inc. Compiled Tue 05-Mar-02 01:14 by pwade Image text-base: 0x08039850, data-base: 0x02005000 ROM: System Bootstrap, Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) ROM: 1600 Software (C1600-BOOT-R), Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Router uptime is 7 minutes System returned to ROM by reload System image file is "flash:c1600-ny-l.120-9.bin" cisco 1602 (68360) processor (revision C) with 7680K/2560K bytes of memory. Processor board ID 14236252, 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) On-board Switched 56K Line Interface. System/IO memory with parity disabled 2048K bytes of DRAM onboard 8192K bytes of DRAM on SIMM System running from FLASH 7K bytes of non-volatile configuration memory. 12288K bytes of processor board PCMCIA flash (Read ONLY) Configuration register is 0x2102 !-- This is the original value of the configuration register. Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#config-register 0x2101 Router(config)#^Z Router# *Mar 1 00:03:32.656: %SYS-5-CONFIG_I: Configured from console by console Router#reload Proceed with reload? [confirm] *Mar 1 00:02:00: %SYS-5-RELOAD: Reload requested System Bootstrap, Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Copyright (c) 1997 by cisco Systems, Inc. C1600 processor with 10240 Kbytes of main memory 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) 1600 Software (C1600-BOOT-R), Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Copyright (c) 1986-1997 by cisco Systems, Inc. Compiled Tue 18-Mar-97 14:01 by ccai Image text-base: 0x04018060, data-base: 0x02005000 cisco 1602 (68360) processor (revision C) with 9728K/512K bytes of memory. Processor board ID 14236252 X.25 software, Version 2.0, NET2, BFE and GOSIP compliant. 1 Ethernet/IEEE 802.3 interface. 1 Serial network interface. On-board Switched 56K Line Interface. System/IO memory with parity disabled 8K bytes of non-volatile configuration memory. 12288K bytes of processor board PCMCIA flash (Read/Write) Press RETURN to get started! 00:00:14: %LINK-3-UPDOWN: Interface Ethernet0, changed state to up Router(boot)>enable Password: Router(boot)# Router(boot)#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(boot)(config)#config-register 0x2102 Router(boot)(config)#^Z Router(boot)# Router(boot)#ping 172.17.247.195 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 172.17.247.195, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/200/1000 ms Router(boot)#copy tftp flash PCMCIA flash directory: File Length Name/status 1 5235300 /c1600-ny-l.120-9 [5235364 bytes used, 7347548 available, 12582912 total] Address or name of remote host [255.255.255.255]? 172.17.247.195 Source file name? c1600-y-l.122-7b.bin Destination file name [c1600-y-l.122-7b.bin]? y Accessing file 'c1600-y-l.122-7b.bin' on 172.17.247.195... Loading c1600-y-l.122-7b.bin from 172.17.247.195 (via Ethernet0): ! [OK] Erase flash device before writing? [confirm] NO !--- Enter "Yes" if your router does not have enough memory in the !--- Flash for both Cisco IOS software images. Copy 'c1600-y-l.122-7b.bin' from server as 'c1600-y-l.122-7b.bin' into Flash WITH erase? [yes/no]N Loading c1600-y-l.122-7b.bin from 172.17.247.195 (via Ethernet0): !!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! [OK - 7120752/12582912 bytes] Verifying checksum... OK (0xA523) Flash device copy took 00:06:28 [hh:mm:ss] Router(boot)#reload *Mar 1 00:30:49.972: %SYS-5-CONFIG_I: Configured from console by consoled System configuration has been modified. Save? [yes/no]: NO Proceed with reload? [confirm] YES *Mar 1 00:13:15: %SYS-5-RELOAD: Reload requested System Bootstrap, Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Copyright (c) 1997 by cisco Systems, Inc. C1600 processor with 10240 Kbytes of main memory 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) 1600 Software (C1600-Y-L), Version 12.2(7b), RELEASE SOFTWARE (fc1) Copyright (c) 1986-2002 by cisco Systems, Inc. Compiled Tue 05-Mar-02 01:14 by pwade Image text-base: 0x08039850, data-base: 0x02005000 cisco 1602 (68360) processor (revision C) with 7680K/2560K bytes of memory. Processor board ID 14236252, 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) On-board Switched 56K Line Interface. System/IO memory with parity disabled 2048K bytes of DRAM onboard 8192K bytes of DRAM on SIMM System running from FLASH 7K bytes of non-volatile configuration memory. 12288K bytes of processor board PCMCIA flash (Read ONLY) Press RETURN to get started!
发出show version命令以验证加载的Cisco IOS软件映像是否正确以及配置寄存器是否为0x2102。
Router >enable Router# show version Cisco Internetwork Operating System Software IOS (tm) 1600 Software (C1600-Y-L), Version 12.2(7b), RELEASE SOFTWARE (fc1) Copyright (c) 1986-2002 by cisco Systems, Inc. Compiled Tue 05-Mar-02 01:14 by pwade Image text-base: 0x08039850, data-base: 0x02005000 ROM: System Bootstrap, Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) ROM: 1600 Software (C1600-BOOT-R), Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Router uptime is 7 minutes System returned to ROM by reload System image file is "flash:c1600-y-l.122-7b.bin" cisco 1602 (68360) processor (revision C) with 7680K/2560K bytes of memory. Processor board ID 14236252, 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) On-board Switched 56K Line Interface. System/IO memory with parity disabled 2048K bytes of DRAM onboard 8192K bytes of DRAM on SIMM System running from FLASH 7K bytes of non-volatile configuration memory. 12288K bytes of processor board PCMCIA flash (Read ONLY) Configuration register is 0x2102