通过CLI升级CiscoCatalyst2900


用TFTP通过CLI(Command Line Interface)升级Cisco Catalyst 2900.XL/3500.XL 交换机IOS
升级前需要留意事项:
1,留意switch上的DRAM (Dynamic Random Access Memory) 及 Flash 的大小 。每个IOS都对DRAM及Flash有一定要求,在升级之前必须要确定DRAM及Flash的大小 。
确定DRAM的大小可以通过命令show version,如
有 8 MB DRAM 的 2900XL switch:
Switch#show version
Cisco Internetwork Operating System Software
IOS (TM) C2900XL Software (C2900XL.C3H2S.M), Version 12.0(5)XU, RELEASE SOFTWARE)
Copyright (c) 1986.2000 by cisco Systems, Inc.
Compiled Mon 03.Apr.00 16:37 by swati
Image text.base: 0x00003000, database: 0x00301398
ROM: Bootstrap program is C2900XL boot loader
2900XL_84.3 uptime is 27 minutes
System returned to ROM by reload
System image file is "flash:c2900XL.c3h2s.mz.120_5.XU.bin"
cisco WS.C2924M.XL (PowerPC403GA) processor (revision 0x11) with 8192K/1024K bytes of memory.
Processor board ID 0x10, with hardware revision 0x03
Last reset from warm.reset
...(output suppressed)
信息显示在交换机上有 8192K DRAM 即 8 MB DRAM
确定FLASH的大小可以通过命令dir flash 如:
switch:dir flash:
(This command is only run if you are at the switch: prompt and want to determine how big the flash
Directory of flash:/
2 .r.. 2535config.text
4 .rwx 1644160c2900XL.c3h2s.mz.120_5.XU.bin
5 .r.. 960vlan.dat
6 .r.. 19env_vars
1963008 bytes available (1649664 bytes used)
2,下载合适的IOS 。通常交换机的IOS有两种文件,一种以tar结尾,另外一种以bin结尾 。
结尾 特点
.tar(压缩文件) ?包含bin文件,boot机文件?包含Html文件,用于web形式治理交换机
.bin 单独IOS文件不包含HTML文件,可以通过TFTP拷贝到交换机上
升级步骤:
1,进入EXEC模式:
switch> enable
switch#
2,显示boot机参数
switch# show boot
BOOT path.list: flash:current_image
Config file: flash:config.text
Enable Break: 1
Manual Boot: no
HELPER path.list:
NVRAM/Config file
buffer size: 32768
3,若BOOT path.list为空, 可以通过dir flash: 去显示以bin结尾的文件
Switch# dir flash:
Directory of flash:
3 ...x 80971current_image.bin
4 d..x 14144html
7 .rwx 84env_vars
5 ...x 111info
258 ...x 111info.ver
230 .rwx 1470config.text
3612672 bytes total (1229312 bytes free)
4,将当前bin文件重命名为新的bin文件 。
Switch# rename flash:current_image flash:new_image
Source filename [current_image]?
Destination filename [new_image]?
例如:
升级一台 8 MB 2900XL switch,在switch上的bin文件为
c2900XL.c3h2.mz.112.8.5.SA6.bin, 你已经从cisco网站上下载了最新IOS文件 :c2900XL.c3h2s.mz.120.5.2.XU.tar
注重:.tar 结尾替换成 .bin.结尾
switch# rename flash:c2900XL.c3h2.mz.112.8.5.SA6.bin flash:c2900XL.c3h2s.mz.120.5.2.XU.bin
Source filename [c2900XL.c3h2.mz.112.8.5.SA6.bin]?
Destination filename [c2900XL.c3h2s.mz.120.5.2.XU.bin]?
注重:重命名只是升级的一个步骤,重命名并不是升级 。
5,检查重命名后的文件 。
Switch# dir flash:
Directory of flash:
3 ...x 80971new_image.bin
4 d..x 14144html
7 .rwx 84env_vars
5 ...x 111info
258 ...x 111info.ver
230 .rwx 1470config.text
3612672 bytes total (1229312 bytes free)
6,进入全局模式:
switch# config terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)#
7,Disable web 服务
switch(config)# no IP http server
8,更改boot 机引导文件

推荐阅读