標籤:交換器ios升級
公司一台裝置, WS-C2960S-24TS-L,是思科24口1000M的二層交換楊,使用的IOS版本為12.2(55) universalk9-M的IOS軟體,最近公司安裝了一些數字網路攝影機,把監控主機和一撞球型監控接到了這台機器上,介面的收發速率遠大於普通辦公用的速率,下面是我複製的兩個介面的速率。
G1/0/3(監控主機介面)
5 minute input rate 2087000 bits/sec, 4065 packets/sec
5 minute output rate 45545000 bits/sec, 4065 packets/sec
G1/0/13(監控球機介面,海康130W像素)
5 minute input rate 2823000 bits/sec, 279 packets/sec
5 minute output rate 146000 bits/sec, 281 packets/sec
發現CPU佔用率高,而且是5秒鐘的佔用為17%,5分鐘的佔用往往超過了50%,為瞭解決CPU佔用率高的問題,決定對機器進行一次升級
查看了tar格式的IOS的升級方法,有兩種
方法一:Switch#archive tar /xtrat tftp://TFTP伺服器IP地址/c3750-ipservicesk9-tar.150-2.SE2.tar flash:
方法二:archive download-sw /leave-old-sw /reload tftp://192.168.12.65/c2960s-universalk9-tar.150-2.SE6.tar flash:/
首先,我使用的保險一點的方法,即將這個IOS下載到交換器的flash:中,並且不刪除原有flash,下載完成後重啟
方法二還有覆蓋原有IOS的選項,但不建議使用。因為一般來說,現在的flash完全可以容納兩個IOS包沒有問題
接下來看我悲催的升級過程
一、 剛好思科的帳號可以下載我這台機器的IOS,我就下載了最新的15.2.2aE1,使用方法將它灌進了FLASH中。但是機器並沒有重啟,我就敲下了reload
二、接下來就等待了,滿心以為不會出問題,因為我2960的百M機器已經實驗過升級到15.0的IOS了。等待了五分鐘還是沒通,到機房查看,只看到左邊那排的第一個燈亮,然後console燈那裡亮,手工斷電再重啟,還是網路不通
三、找了台筆記本,串口串連進去,發現系統進去了,enable模式也可以進去,但是就是沒法查看flash,設定檔不生效,然後也不能進行一些配置。杯具了!
四、以前的老方法都是在IP環境下copy tffp:/ flash:/,即將bin檔案複製過去升級的,除了那個百M的升級tar檔案到15.0以外,所以有些不知道怎麼辦了
五、按位mode斷電重啟,進入到最小系統模式,注意,不是提示的rommon> 好像是switch:還是怎麼的?
六、查看這裡只有flash_init和boot這兩個命令了
七、flash_init,對於這個我理解錯了,以為進行初始化以後,相當於把flash格盤了,就這點註定了四個小時的加班,其實這個命令應該是告訴我們將flash進行了掛載,在最小系統模式下可以查看flash了,而我以為已經格式化了,然後,敲入了這個命令以後,可以查看一些別的命令,比如dir這些。我當時在進入那個15.0的系統時show flash用不了,以為flash損壞了,沒辦法,只好使用xmodem來發送資料包了,
copy xmodem: flash:image_filename.bin
(在這中間,使用一個備用的100M2960將原來備份的配置恢複過去,還好經常備份)
八、接下來就用CRT軟體,使用xmodem來傳輸檔案了,真心慢
九、回宿舍等待的過程中,看到網上有人說可以將傳輸速率設定成115200 set buad 115200,沒報錯,但將電腦的串口設定成這個速率,直接死機,弄了兩次,死了兩次,重新用9600的速率將15.0的se6弄過去,傳送檔案,速度不到1K
十、回宿舍睡覺並思考為什麼,開始以為是那個IOS版本叫aE1,好像看到支援SSH,以為這個版本是專門為企業版用的
十一、第二天回辦公室,IOS弄好了
十二、重啟,結果顯示和15.2.2aE1一樣,在開機的時候會有顯示無效的許可之類的資訊,和平常的系統啟動不同。然後那些命令同樣使用不了。恨得牙都痒痒的了。想著不會真要重新把12.2那個弄回去吧?
十三、再重啟,按MODE,進入最小系統模式switch: ,敲入flash_init。 一般思考,應該 flash並沒有損壞,而且IOS也已經弄進去了,但唯一可能的原因是這台機器不支援升級到15.0的系統。
然後再敲了一個?(這之間有沒有敲入load_help不記得了),突然看到有一個很熟悉的命令dir,可以看到 flash裡面有檔案,而且原來的IOS還在,新灌的IOS也在,將原來12.2的IOS的路徑複製下來。直接 boot flash:/原有IOS的路徑/檔案名稱,進入了原來的系統,配置也在。
十四、使用tftp,再使用copy tftp:/ flash:/ ,將一個12.2(58)SE2的IOS複製到flash:
十五、再使用boot system 路徑,將系統的啟動IOS設定成58的這個IOS
至此,系統升級成了12.2(58)SE2的系統,並沒有升級到15.0的系統
總結:
1. 如果要升級的話,可以使用方法一和方法二,方法一是將tar包解壓到了flash中,但不應用,方法二是保留原有的IOS升級,並重啟
2. 還可以將tar包解壓,複製裡面的bin檔案到flash中
3.在升級前一定記得要備份設定檔到本地
4.將flash裡面的目錄用手機拍照,記錄片,然後將原有的啟動路徑記清,使用show boot命令
5.如果使用download-sw /leaveoldsw這個命令的話,原有的IOS會保留,雖然進入新的系統不支援生產環境的配置,但可以使用boot system這個命令,可以直接使用boot system這個命令設定成原來的IOS啟動,並不會耽擱很多時間
6.在switch:這個最小系統裡面設定了boot 路徑,第一次可以重啟到你原來的IOS,但進入到原來的IOS裡面,仍然要使用boot sytem這個命令指定你的IOS路徑,這樣才會在下次重啟時使用你預期的IOS啟動
7.不用懷疑,雖然思科的背板比華為的要低好多,但依照我的結果,一個介面輸入2Mbps,輸入45Mbps完全沒有問題,不會丟包或者其他
結果:將系統升級到12.2(58)後,原來的CPU佔用率高已經解決了,看來還是軟體的bug。現在使用正常,CPU佔用率13%
由於過程,沒有記錄下來,所以無法貼圖,但相信大家應該可以根據我的過程和總結解決IOS升級的問題,有問題請看思科的手冊。這是最好的辦法。
看到網上的方法都是原來的老方法,特將此檔案分享權限設定出來,希望幫到新學的朋友,另將思科的手冊裡面的升級方法粘貼如下
Switch software can be corrupted during an upgrade, by downloading the wrong file to the switch, and
by deleting the image file. In all of these cases, the switch does not pass the power-on self-test (POST),
and there is no connectivity.
This procedure uses the Xmodem Protocol to recover from a corrupt or wrong image file. There are many
software packages that support the Xmodem Protocol, and this procedure is largely dependent on the
emulation software that you are using.
This recovery procedure requires that you have physical access to the switch.
Step 1 From your PC, download the software image tar file (image_filename.tar) from Cisco.com.
The Cisco IOS image is stored as a bin file in a directory in the tar file. For information about locating
the software image files on Cisco.com, see the release notes.
Step 2 Extract the bin file from the tar file.
If you are using Windows, use a zip program that can read a tar file. Use the zip program to navigate
to and extract the bin file.
If you are using UNIX, follow these steps:
1. Display the contents of the tar file by using the tar -tvf <image_filename.tar> UNIX command.
unix-1% tar -tvf image_filename.tar
2. Locate the bin file, and extract it by using the tar -xvf <image_filename.tar>
<image_filename.bin> UNIX command.
unix-1% tar -xvf image_filename.tar image_filename.bin
x c2960-lanbase-mz.122-25.FX/c2960-lanbase-mz.122-25.FX.bin, 2928176 bytes, 5720
tape blocks
3. Verify that the bin file was extracted by using the ls -l <image_filename.bin> UNIX command.
unix-1% ls -l image_filename.bin
-rw-r--r-- 1 boba 2928176 Apr 21 12:01
c2960-lanbase-mz.122-25.FX/c2960-lanbase-mz.122-25.FX.bin
Step 3 Connect your PC with terminal-emulation software supporting the Xmodem Protocol to the switch
console port.
Step 4 Set the line speed on the emulation software to 9600 baud.
Step 5 Unplug the switch power cord.
Step 6 Press the Mode button and at the same time, reconnect the power cord to the switch.
You can release the Mode button a second or two after the LED above port 1 goes off. Several lines of
information about the software appear along with instructions:
39-3
Catalyst 2960 and 2960-S Switches Software Configuration Guide, Release 15.0(1)SE
OL-26520-01
Chapter 39 Troubleshooting
Recovering from a Lost or Forgotten Password
The system has been interrupted prior to initializing the flash file system. The following
commands will initialize the flash file system, and finish loading the operating system
software#
flash_init
load_helper
boot
Step 7 Initialize the flash file system:
switch: flash_init
Step 8 If you had set the console port speed to anything other than 9600, it has been reset to that particular
speed. Change the emulation software line speed to match that of the switch console port.
Step 9 Load any helper files:
switch: load_helper
Step 10 Start the file transfer by using the Xmodem Protocol.
switch: copy xmodem: flash:image_filename.bin
Step 11 After the Xmodem request appears, use the appropriate command on the terminal-emulation software to
start the transfer and to copy the software image into flash memory.
Step 12 Boot the newly downloaded Cisco IOS image.
switch:boot flash:image_filename.bin
Step 13 Use the archive download-sw privileged EXEC command to download the software image to the switch
or to the switch stack.
Step 14 Use the reload privileged EXEC command to restart the switch and to verify that the new software image
is operating properly.
Step 15 Delete the flash:image_filename.bin file from the switch.
本文出自 “神策” 部落格,請務必保留此出處http://liu008qing.blog.51cto.com/151315/1603700
一次不成功的思科2960S交換器的IOS升級