扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
用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.. 2535 config.text
4 .rwx 1644160 c2900XL.c3h2s.mz.120_5.XU.bin
5 .r.. 960 vlan.dat
6 .r.. 19 env_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 80971 current_image.bin
4 d..x 14144 html
7 .rwx 84 env_vars
5 ...x 111 info
258 ...x 111 info.ver
230 .rwx 1470 config.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 80971 new_image.bin
4 d..x 14144 html
7 .rwx 84 env_vars
5 ...x 111 info
258 ...x 111 info.ver
230 .rwx 1470 config.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 机引导文件
Switch(config)# boot system flash:new_image
9, 返回 privileged EXEC mode:
switch(config)# end
10, 删除HTML文件:
switch# delete flash:html/*
11, 如果从11.2(8)SA5 或更早的版本升级, 还要删除SNMP目录及下面的文件
switch# delete flash:html/Snmp/*
注意 'S'在 'SNMP'里是大写。
12, 如果从11.2(8)SA5 或更早的版本升级,要在删除后建立SNMP目录
switch# mkdir flash:html/Snmp
13, 使用tar命令进行升级
Switch#tar /x tftp://server_ip_address//path/filename.tar flash:
Loading /path/filename.tar from server_ip_address (via VLAN1):!)
extracting info (111 bytes)
extracting filename.bin (1557286 bytes)!!!!!!!!!!!!!!!!!!!!
html/ (directory)
extracting html/Detective.html.gz (1139 bytes)!
extracting html/ieGraph.html.gz (553 bytes)
extracting html/DrawGraph.html.gz (787 bytes)!
. . .(output Suppressed)
[OK . 2723840 bytes]
(This message means that the TFTP process has passed successfully and both .bin and html files have been extracted successfully)
14, 进入全局设置模式
switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
15, 重新启动web服务
switch(config)# IP http server
16, 返回 privileged EXEC 模式:
switch(config)# end
17, Reload 交换机
switch# reload
System configuration has been modified. Save? [yes/no]:y
Proceed with reload? [confirm]
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。