用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] 升級完畢