本文档说明升级 Catalyst 4500/4000 系列交换机上的软件镜像的分步过程,这些交换机在 Supervisor I 和 II 模块上运行 CatOS、在 4232-L3 模块上运行 Cisco IOS® 以及在 Supervisor III、IV 和 V 模块上运行 Cisco IOS。以下原因导致需要进行软件镜像升级:
在您的网络中实现新的软件版本提供的新功能。
安装在交换机上运行的当前软件版本不支持的新线卡。
修复影响您的交换机的已知 Bug(如果该 Bug 在后续软件版本中得到解决)。
尝试进行此配置之前,请确保满足以下要求:
验证内存和 Boot ROM 要求。
下载有效的软件镜像。
在您的 PC 上安装 TFTP 服务器。
备份当前交换机配置和软件映像。
有关这些要求的详细信息,请参阅本文档的背景信息部分。
本文档不限于特定的软件和硬件版本。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
本部分介绍要求部分的项目。
确定新软件版本需要的最少 DRAM、闪存和最低 Boot ROM 版本。检查您的交换机是否支持这些要求。您可以参考发行版本注释验证新软件镜像的要求。请参阅 Catalyst 4500/4000 系列交换机发行版本注释。
show version命令将在交换机上显示引导程序ROM版本、已安装的DRAM和Bootflash尺寸。
以下是 show version 命令在运行 CatOS 的 Catalyst 4500/4000 上的输出:
4006> (enable) show version WS-C4006 Software, Version NmpSW: 7.2(2) Copyright (c) 1995-2002 by Cisco Systems, Inc. NMP S/W compiled on Apr 25 2002, 15:07:51 GSP S/W compiled on Apr 25 2002, 14:51:18 System Bootstrap Version: 5.4(1) !--- This is the boot ROM version that runs on your switch. Hardware Version: 1.2 Model: WS-C4006 Serial #: FOX04243254 Mod Port Model Serial # Versions --- ---- ------------------ -------------------- --------------------------------- 1 2 WS-X4013 JAB043300MG Hw : 1.2 Gsp: 7.2(2.0) Nmp: 7.2(2) 2 48 WS-X4148-RJ45V JAE0621004J Hw : 1.6 3 34 WS-X4232-L3 JAB054306MQ Hw : 1.7 DRAM FLASH NVRAM Module Total Used Free Total Used Free Total Used Free ------ ------- ------- ------- ------- ------- ------- ----- ----- ----- 1 65536K 39209K 26327K 16384K 5507K 10877K 480K 327K 153K !--- The amount of DRAM and Flash size on the switch. Uptime is 0 day, 4 hours, 18 minutes 4006> (enable
以下是 show version 命令在运行集成 Cisco IOS 的 Catalyst 4500/4000 上的输出:
c-4000#show version Cisco Internetwork Operating System Software IOS (tm) Catalyst 4000 L3 Switch Software (cat4000-IS-M), Version 12.1(12c)EW1, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) TAC Support: http://www.cisco.com/tac Copyright (c) 1986-2002 by cisco Systems, Inc. Compiled Thu 24-Oct-02 23:05 by eaarmas Image text-base: 0x00000000, data-base: 0x00CA7368 !--- This is the boot ROM version that runs on your switch. ROM: 12.1(11br)EW Dagobah Revision 50, Swamp Revision 16 c-4000 uptime is 1 week, 2 days, 1 hour, 38 minutes System returned to ROM by reload System image file is "bootflash:cat4000-is-mz.121-12c.EW1.bin" !--- The DRAM on the Supervisor module. cisco WS-C4006 (MPC8245) processor (revision 7) with 262144K bytes of memory. Processor board ID FOX04183666 Last reset from Reload 80 FastEthernet/IEEE 802.3 interface(s) 52 Gigabit Ethernet/IEEE 802.3 interface(s) 467K bytes of non-volatile configuration memory. Configuration register is 0x2102 c-4000#
在进行实际的镜像升级之前,先将软件镜像下载到充当 TFTP 服务器的 PC 上。从 Catalyst 4000 软件下载中心(仅限注册用户)下载 CatOS 或集成 Cisco IOS 软件镜像。
对于本文的示例输出,Cisco TFTP 服务器安装在运行 Microsoft Windows 2000 Professional 的 PC 上。可使用可在任何平台上安装的所有 TFTP 服务器。无需使用安装有 Windows 操作系统的 PC。
步骤 1:从 Internet 上下载任意共享 TFTP 软件,并将其安装在用于将软件镜像复制到交换机的 PC 上。将软件镜像下载到 TFTP 服务器根目录。您可以将镜像下载到 TFTP 服务器的默认根目录,也可以将根目录路径更改为软件镜像所在的目录。对于 Cisco TFTP 服务器,请选择 View Menu > Options 更改根目录。
注意: 在撰写本文档时,已经可通过软件中心下载 Cisco TFTP 服务器。Cisco 不再支持 Cisco TFTP 服务器。如果您使用的是 Cisco TFTP 服务器,请禁用日志功能,以免生成过多日志导致中断 TFTP 进程。选择 View Menu > Options 在 Cisco TFTP 服务器上禁用日志。或者,取消选中 Enable Logging,并单击 Ok。默认情况下将启用日志记录。
步骤 2:连接交换机控制台端口和 PC 之间的控制台电缆,以便访问交换机命令行界面 (CLI)。有关如何通过 HyperTerminal 访问 CLI 的信息,请参阅将终端连接到 Catalyst 交换机上的控制台端口。
注意: 可以使用远程 Telnet 访问来升级交换机。然而,当您在软件升级期间重新加载交换机时,您将丢失 Telnet 连接。加载新镜像后,您可以重建 Telnet 连接。不过,要在出现错误时排除故障,您需要有本地控制台访问权限。Cisco 建议通过控制台访问升级交换机。
将交换机配置和当前软件镜像备份到运行 TFTP 服务器的 PC 上。有时,升级过程可能因以下原因而失败:
内存不足
交换机的 Bootflash 中没有足够的空间来支持新镜像
可以使用交换机中原有的相同镜像将交换机恢复到正常模式。如果您因任何原因而丢失交换机配置,则可以从 TFTP 服务器恢复这些配置。另请参阅本文档的已知问题:因软件降级导致 CatOS 交换机配置丢失部分,以获取详细信息。有关如何管理运行 CatOS 的 Catalyst 4000 交换机上的配置文件和软件镜像的信息,请参阅在 Catalyst 交换机上管理软件镜像和使用配置文件。
在运行集成 Cisco IOS 的 Catalyst 4500/4000 交换机上,可以发出 copy startup-config tftp:或者 copy startup-config bootflash:命令,以将配置复制到 TFTP 服务器或 Bootflash。如果您已经修改了配置,请保证发送write memory命令将当前配置复制到启动配置中,并执行备份。发出 copy bootflash:tftp :或者 copy slot0:tftp :命令,以将当前软件镜像从 Bootflash 或 slot0 复制到 TFTP 服务器。
本部分提供有关如何配置本文档所述功能的信息。
注意: 使用命令查找工具(仅限注册用户)可获取有关本部分所使用命令的详细信息。
运行 CatOS 的 Catalyst 4003 (Supervisor I) 和 4006 (Supervisor II) 交换机不支持 PCMCIA 闪存卡。您只有从TFTP服务器上将新软件镜像复制到交换机Bootflash的选项。
步骤 1:确保验证内存或 Boot ROM 要求,已在 PC 上安装 TFTP 服务器,并且可从交换机控制台端口访问交换机控制台。如果您没准备好这些设置,请参阅本文档的要求部分。
步骤 2:配置管理 IP 地址 (sc0)。检查交换机与安装有 TFTP 服务器的 PC 之间的连通性。在此示例情景中,将 10.10.10.1 IP 地址用于交换机管理,并将 10.10.10.2 IP 地址用于 TFTP 服务器。
!--- The management (sc0) IP address is configured on the switch. Cat4006> (enable) set interface sc0 1 10.10.10.1 255.255.255.0 Interface sc0 vlan set, IP address and netmask set. !--- Verify the management (sc0) IP address. Cat4006> (enable) show interface sl0: flags=50<DOWN,POINTOPOINT,RUNNING> slip 0.0.0.0 dest 0.0.0.0 !--- Set the sc0 in VLAN1 and the switch port that connects to the PC is in VLAN1. sc0: flags=63<UP,BROADCAST,RUNNING> vlan 1 inet 10.10.10.1 netmask 255.255.255.0 broadcast 10.10.10.255 me1: flags=63<UP,BROADCAST,RUNNING> inet 1.1.1.1 netmask 255.255.255.0 broadcast 1.1.1.255 !--- Verify the IP connectivity between the switch and PC with the TFTP server. Cat4006> (enable) ping 10.10.10.2 !!!!! ----10.10.10.2 PING Statistics---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip (ms) min/avg/max = 1/3/7 Cat4006> (enable
步骤 3:验证您在 Bootflash 中是否有足够的可用空间,可将新镜像从 TFTP 服务器复制到 Bootflash。您可以检查下载新镜像的 PC 上的新镜像大小。
Cat4006> (enable) dir bootflash: -#- -length- -----date/time------ name 1 36688 Mar 20 2003 17:07:39 switch.cfg 2 4127708 Jul 12 2003 10:59:39 cat4000.6-3-8.bin 11563988 bytes available (4164652 bytes used) Cat4006> (enable) !--- You have now verified that the new image size is around 4.5 MB. !--- The space available on bootflash is around 11.5 MB, which is sufficient.
如果没有足够的可用空间用于复制新镜像,请使用 delete 命令删除当前镜像。发出 squeeze 命令永久擦除标记为“已删除”的文件,为新镜像腾出更多可用空间。
Switch>(enable) delete bootflash: [cat4000.6-3-8.bin]? Delete bootflash:cat4000.6-3-8.bin?[confirm]
Switch>(enable)squeeze bootflash: All deleted files will be removed, proceed (y/n) [n]? y Squeeze operation may take a while, proceed (y/n) [n]? y Erasing squeeze log Squeeze of bootflash complete.
步骤 4:从 TFTP 服务器上将新的软件镜像复制到 Bootflash 中,并验证是否已正确复制该镜像。确认新镜像的文件大小是否与 Cisco.com 上的软件中心(仅限注册用户)中指定的大小完全相同。 如果存在差别,则表示镜像在转移期间可能出现损坏。重新下载镜像,以确保交换机在重新加载之后不会进入 ROMmon 模式。
Cat4006> (enable) copy tftp bootflash: IP address or name of remote host []? 10.10.10.2 Name of file to copy from []? cat4000-k8.7-4-1.bin 11563860 bytes available on device bootflash, proceed (y/n) [n]? y CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCC File has been copied successfully. Cat4006> (enable) Cat4006> (enable) dir bootflash: -#- -length- -----date/time------ name 1 36688 Mar 20 2003 17:07:39 switch.cfg 2 4127708 Jul 12 2003 10:59:39 cat4000.6-3-8.bin 3 4470132 Jul 31 2003 17:58:48 cat4000-k8.7-4-1.bin 7093728 bytes available (8634912 bytes used) Cat4006> (enable)
您也可以使用 verify 命令确认闪存设备上的文件的校验和:
Cat4006>(enable) verify bootflash:cat4000-k8.7-4-1.bin CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC Starting verification on file bootflash:cat4000-k8.7-4-1.bin ............................................................. ............................................................. ............................................................. ............................................................. ............................................................. ................................................... File bootflash:cat4000-k8.7-4-1.bin verified and is Ok. Cat4006>(enable)
步骤 5:清除旧的引导变量,以便在 Bootflash 中存在旧镜像时,交换机也不使用旧镜像进行引导。配置新的引导变量,以便重置以后交换机引导的新软件镜像。
Cat4006> (enable) show boot !--- Previously, the switch used this image to boot. BOOT variable = bootflash:cat4000.6-3-8.bin,1; CONFIG_FILE variable = Configuration register is 0x2102 ignore-config: disabled auto-config: non-recurring console baud: 9600 boot: image specified by the boot system commands !--- Old boot variable is clear. Also, you can issue the !--- clear boot system all command to clear all the boot variables. Cat4006> (enable)clear boot system flash bootflash:cat4000.6-3-8.bin BOOT variable = !--- New boot variable is configured. Cat4006> (enable) set boot system flash bootflash:cat4000-k8.7-4-1.bin BOOT variable = bootflash:cat4000-k8.7-4-1.bin,1; !--- If you do not want to clear the old boot variable, use the !--- keyword prepend with the set boot system flash command !--- so that the new boot variable is set at first priority. For example, issue !--- the set boot system flash bootflash:cat4000-k8.7-4-1.bin prepend !--- command for this example. Cat4006> (enable) show boot BOOT variable = bootflash:cat4000-k8.7-4-1.bin,1; CONFIG_FILE variable = !--- Make sure that the config-register is set to 0x2102 so that the switch !--- uses the valid software image to boot. You can change the !--- config-register with the set boot config-register 0x2102 !--- command. If the boot variable is not specified correctly, your switch can !--- go into ROMmon mode after the reload. Configuration register is 0x2102 ignore-config: disabled auto-config: non-recurring console baud: 9600 boot: image specified by the boot system commands Cat4006> (enable)
步骤 6:重置交换机,以使交换机在重新加载期间使用新的软件镜像进行引导。
Cat4006> (enable) reset This command will reset the system. Do you want to continue (y/n) [n]? y 2003 Jul 31 18:05:10 %SYS-5-SYS_RESET:System reset from Console// Cat4006> (enable) 0:00.586648: No gateway has been specified 0:00.588434: ig0: 00:02:b9:80:85:fe is 200.200.201.1 0:00.589044: netmask: 255.255.255.0 0:00.589385: broadcast: 200.200.201.255 0:00.589754: gateway: 0.0.0.0 WS-X4013 bootrom version 6.1(4), built on 2001.07.30 14:43:26 H/W Revisions: Crumb: 5 Rancor: 8 Board: 2 Supervisor MAC addresses: 00:02:b9:80:82:00 through 00:02:b9:80:85:ff (1024 addresses) Installed memory: 64 MB Testing LEDs.... done! The system will autoboot in 5 seconds. Type control-C to prevent autobooting. rommon 1 > The system will now begin autobooting. !--- The switch now boots with the new image. Autobooting image: "bootflash:cat4000-k8.7-4-1.bin" ................................................................... ........................................................ .............################################ Starting Off-line Diagnostics Mapping in TempFs Board type is WS-X4013 DiagBootMode value is "post" Loading diagnostics... Enter password: 2003 Jul 31 18:06:19 %SYS-5-MOD_OK:Module 1 is online Cat4006>
步骤 7:验证交换机上是否已安装新的软件版本。
Cat4006> (enable) show version WS-C4006 Software, Version NmpSW: 7.4(1) !--- The switch is running CatOS version 7.4(1). Copyright (c) 1995-2002 by Cisco Systems, Inc. NMP S/W compiled on Sep 20 2002, 11:46:26 GSP S/W compiled on Sep 20 2002, 11:24:50 System Bootstrap Version: 6.1(4) Hardware Version: 1.2 Model: WS-C4006 Serial #: FOX04183883 Mod Port Model Serial # Versions --- ---- ------------------ -------------------- --------------------------------- 1 2 WS-X4013 JAB04300631 Hw : 1.2 Gsp: 7.4(1.0) Nmp: 7.4(1) 4 34 WS-X4232-GB-RJ JAB041404EL Hw : 2.3 5 48 WS-X4148-RJ21 JAB03450310 Hw : 0.2 DRAM FLASH NVRAM Module Total Used Free Total Used Free Total Used Free ------ ------- ------- ------- ------- ------- ------- ----- ----- ----- 1 65536K 39227K 26309K 16384K 9457K 6927K 480K 327K 153K Uptime is 0 day, 0 hour, 0 minute Cat4006> (enable)
如果交换机加载失败或者未能保持 rommon> 模式,请参阅本文档的软件升级故障 / 交换机处于 ROMmon 模式部分,寻求进一步帮助。
请参阅如何在 Catalyst 交换机第 3 层模块上升级软件镜像,以获取在 4232-L3 模块上升级软件的分步过程:
请参阅 Catalyst 4000 系列交换机 Cisco IOS 发行版本注释的升级系统软件部分,以获取升级 Catalyst 4500/4000 Supervisor III 和 IV 模块上的集成 Cisco IOS 的分步过程。
Cisco Catalyst 4500 系列交换机允许在主 Supervisor 引擎发生故障时由备用 Supervisor 引擎进行接管。通过这种方式,当一个 Supervisor 引擎发生故障时,Cisco Catalyst 4500 系列交换机可使交换机迅速恢复操作。此功能称为 Supervisor 引擎冗余。通过 Supervisor 引擎冗余功能支持的软件升级过程,可以在 Supervisor 引擎上升级 Cisco IOS 软件镜像,而无需重新加载系统。
要升级软件,请完成以下步骤:
使用以下命令在两个 Supervisor 引擎上将新的 Cisco IOS 软件镜像复制到 Bootflash 或 slot0:
在活动的 Supervisor 上:
copy source_device:来源_filename slot0: target_filename
copy source_device:source_filename bootflash:target_filename
在备用 Supervisor 上:
copy source_device:source_filename slaveslot0 :target_filename
copy source_device:source_filename slavebootflash:target_filename
配置 Supervisor 引擎以引导新的镜像。使用下列命令:
Switch#configure terminal Switch(config)#config-register 0x2 Switch(config)#boot system flash device:file_name
同步 Supervisor 引擎配置:
Switch(config)#redundancy Switch(config-red)#main-cpu Swicth(config-r-mc)#auto-syn standard
发出 copy running-config start-config 命令以保存配置。
发出 redundancy reload peer 命令,以重新加载备用 Supervisor 引擎并使该引擎重新联机(使用新版本的 Cisco IOS 软件)。
注意: 在重新加载备用 Supervisor 引擎前,请先确保等待足够长的时间,以保证所有配置同步更改都已完成。
使用 redundancy force-switchover 命令手动切换到备用 Supervisor 引擎。
备用 Supervisor 引擎成为运行新 Cisco IOS 软件镜像的活动 Supervisor 引擎。模块重新加载,并从活动 Supervisor 引擎下载模块软件。最初的活动 Supervisor 引擎将使用新镜像重新引导,并成为备用 Supervisor 引擎。
使用本部分可确认配置能否正常运行。
命令输出解释程序(仅限注册用户)(OIT) 支持某些 show 命令。使用 OIT 可查看对 show 命令输出的分析。
show version - 验证新的交换机运行的是否是新的软件版本。
本部分提供的信息可用于对配置进行故障排除。
您的软件升级可能因以下原因而失败:
交换机和 TFTP 服务器之间的 IP 连通性问题
引导变量设置错误
将软件镜像复制到交换机时断电
升级失败后,交换机可能进入 ROMmon 模式。如果您的交换机处于 ROMmon 模式,并且您在 Bootflash 或微型闪存(只在 Supervisor III 和 IV 上)中没有有效镜像,您可以通过软件恢复过程将交换机恢复为正常模式。请参阅以下文档了解软件恢复过程:
如果在活动和备用 Supervisor 引擎上都执行软件升级,请检查这两个 Supervisor 运行的是否是相同的新软件镜像。
当主 Supervisor 从辅助 Supervisor 下载配置时升级失败。辅助 Supervisor 将其自身的引导变量复制到主 Supervisor。如果主 Supervisor 没有与辅助 Supervisor 相同的软件镜像,将出现引导循环,因为主 Supervisor 找不到镜像。要解决此问题,请完成以下步骤:
删除主 Supervisor。
切换到 ROMmon 模式。
手动引导主 Supervisor。
确保主 Supervisor 加载与另一 Supervisor 引擎相同的镜像。镜像加载后,重置您的引导变量。Supervisor 引擎恢复后,请升级其中一个 Supervisor 以便与另一 Supervisor 拥有相同的镜像。
在运行 CatOS 的交换机上进行软件降级总会导致配置丢失。可发出 copy config tftp 命令,以便将配置备份到 TFTP 服务器。或者,发出 copy config flash 命令,以便将配置备份到闪存设备。
为了在成功降级之后恢复配置,请发出 copy tftp config 或 copy flash config 命令,从 TFTP 服务器或闪存设备获取配置文件。
有关这些命令的命令语法和使用,请参阅 Catalyst 4500 命令参考指南。