30
2022
06
17:19:08

一次不成功的思科2960S交换机的IOS升级



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

公司一台设备, 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://www.hqyman.cn/post/2407.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: