A-A+

Cisco交换机升级IOS的具体方法

2016年01月02日 路由器高级应用 暂无评论 阅读 2 views 次

Cisco交换机的IOS升级,其实挺简单的,但是需要注意的是,不能让交换机flash存储为空,一定要有一个IOS在,否则没有IOS在flash里面,等着用xmodem上传IOS吧,那样你的时间可以是废了很多啊。因为对于Cisco Catalyst 2950、2960、3550交换机丢失IOS或IOS故障时,是无法使用rommon模式的,因为压根儿就没有,只有Cisco Catalyst 4006、4506才有rommon模式,本篇文章以Cisco Catalyst 2950为例。

1、首先下载TFTP Server,如何使用这里就不多说了,不明白的可以看这里,进入特权模式,配置端口ip,以便交换机与tftp服务器相连接。

  1. Switch>en ——进入特权模式  
  2. Switch#conf t ——进入全局配置模式  
  3. Enter configuration commands, one per line. End with CNTL/Z.  
  4. Switch(config)#int vlan 1 ——进入端口vlan 1  
  5. Switch(config-if)#ip add 10.0.23.112 255.255.255.0 ——-配置vlan 1的ip地址为10.0.23.112  

2、测试一下tftp服务器与交换机之间的网络连接是否畅通,畅通后,我们在交换机下查看flash情况。

  1. Switch#show flash: ——-显示flash下的信息  
  2. Directory of flash:/  
  3. 2 -rwx 3122176 Mar 01 1993 00:34:02 +00:00c2950-i6q4l2-mz.121-22.EA9 ——–现在所使用的IOS文件  
  4. .bin  
  5. 3 -rwx 5 Mar 01 1993 00:01:17 +00:00 private-config.text  
  6. 5 -rwx 1148 Mar 01 1993 00:01:17 +00:00 config.text  
  7. 7741440 bytes total (4616192 bytes free)  

3、上传新的IOS文件到交换机的flash存储中。将新的交换机IOS文件放入tftp服务器的根目录下。如果复制过程中出现not enough spaces提示,请先删除原来的IOS文件,如何删除IOS文件这里就不再提了,请访问这里参阅。

  1. Switch#copy tftp flash: ——-从tftp拷贝文件到flash存储中  
  2. Address or name of remote host []? 10.0.23.4 ——tftp服务器ip地址  
  3. Source filename []? c2950-i6k2l2q4-mz.121-22.EA14.bin ——–要从tftp服务器中拷贝的文件名称  
  4. Destination filename [c2950-i6k2l2q4-mz.121-22.EA14.bin]? ——–保存到flash中的文件名称,可以直接回车  
  5. Accessing tftp://10.0.23.4/c2950-i6k2l2q4-mz.121-22.EA14.bin…  
  6. Loading c2950-i6k2l2q4-mz.121-22.EA14.bin from 10.0.23.4 (via Vlan1):!!!!!!!!!!  
  7.   
  8. 3722814 bytes copied in 87.708 secs (42446bytes/sec)  

4、此时在我的交换机flash存储中就有了两个IOS文件,如果由于flash空间造成的只有一个新的IOS文件,默认重启是会自动加载新的IOS文件,直至正常启动,配置不会丢失,如果有两个IOS文件,此时我们就需要进行手动加载新的IOS设置。先把交换机断电,按住交换机的“mode”按钮,通常在交换机的正面,加电,此时不要松开“mode”按钮,会进入以下模式。

  1. C2950 Boot Loader (C2950-HBOOT-M) Version 12.1(11r)EA1, RELEASE SOFTWARE (fc1)  
  2. Compiled Mon 22-Jul-02 18:57 by antonino  
  3. WS-C2950-24 starting…  
  4. Base ethernet MAC Address: 00:07:eb:85:0a:40  
  5. Xmodem file system is available.  
  6. The system has been interrupted prior toinitializing the  
  7. flash filesystem. The following commands will initialize  
  8. the flash filesystem, and finish loading the operating  
  9. system software:  
  10. flash_init  
  11. load_helper  
  12. boot  
  13. switch:  

5、配置初始化flash

  1. switch: flash_init ——初始化flash  
  2. Initializing Flash…  
  3. flashfs[0]: 4 files, 1 directories  
  4. flashfs[0]: 0 orphaned files, 0 orphaned directories  
  5. flashfs[0]: Total bytes: 7741440  
  6. flashfs[0]: Bytes used: 6848512  
  7. flashfs[0]: Bytes available: 892928  
  8. flashfs[0]: flashfs fsck took 8 seconds.  
  9. …done initializing flash.  
  10. Boot Sector Filesystem (bs:) installed, fsid: 3  
  11. Parameter Block Filesystem (pb:) installed, fsid: 4  
  12. switch: dir flash: ——-显示flash下的文件  
  13. Directory of flash:/  
  14. 2 -rwx3122176 c2950-i6q4l2-mz.121-22.EA9.bin  
  15. 3 -rwx 5 private-config.text  
  16. 4 -rwx 3722814 c2950-i6k2l2q4-mz.121-22.EA14.bin  
  17. 5 -rwx 1148 config.text  
  18. 892928 bytes available (6848512 bytes used)  
  19. switch: boot flash:c2950-i6k2l2q4-mz.121-22.EA14.bin ———指定新的IOS文件启动。  

6、回车后加载新的IOS文件,直至进入系统。

  1. Loading “flash:c2950-i6k2l2q4-mz.121-22.EA14.bin”…############################  
  2. File“flash:c2950-i6k2l2q4-mz.121-22.EA14.bin” uncompressed and installed, entry  
  3. point: 0x80010000  
  4. executing…  
  5. Restricted Rights Legend  
  6. Use, duplication, or disclosure by theGovernment is  
  7. subject to restrictions as set forth in subparagraph  
  8. (c) of the Commercial Computer Software – Restricted  
  9. Rights clause at FAR sec. 52.227-19 and subparagraph  
  10. (c) (1) (ii) of the Rights in Technical Data and Computer  
  11. Software clause at DFARS sec. 252.227-7013.  
  12. cisco Systems, Inc.  
  13. 170 West Tasman Drive  
  14. San Jose, California 95134-1706  
  15. Cisco Internetwork Operating SystemSoftware  
  16. IOS  C2950 Software (C2950-I6K2L2Q4-M), Version 12.1(22)EA14, RELEASE SOFTWA  
  17. RE (fc1)  
  18. Technical Support: http://www.cisco.com/techsupport  
  19.   
  20. Copyright (c) 1986-2010 by cisco Systems, Inc.  
  21. Compiled Tue 26-Oct-10 10:35 by nburra  
  22. Image text-base: 0x80010000, data-base: 0x80680000  
  23. Initializing flashfs…  
  24. flashfs[1]: 4 files, 1 directories  
  25. flashfs[1]: 0 orphaned files, 0 orphaned directories  
  26. flashfs[1]: Total bytes: 7741440  
  27. flashfs[1]: Bytes used: 6848512  
  28. flashfs[1]: Bytes available: 892928  
  29. flashfs[1]: flashfs fsck took 8 seconds.  
  30. flashfs[1]: Initialization complete.  
  31. Done initializing flashfs.  
  32. POST: System Board Test : Passed  
  33. POST: Ethernet Controller Test : Passed  
  34. ASIC Initialization Passed  
  35. POST: FRONT-END LOOPBACK TEST : Passed  
  36. This product contains cryptographic features and is subject to United  
  37. States and local country laws governing import, export, transfer and  
  38. use. Delivery of Cisco cryptographic products does not imply  
  39. third-party authority to import, export, distribute or use encryption.  
  40. Importers, exporters, distributors and users are responsible for   
  41. compliance with U.S. and local country laws. By using this product you  
  42. agree to comply with applicable laws and regulations. If you are unable  
  43. to comply with U.S. and local laws, return this product immediately.  
  44. A summary of U.S. laws governing Ciscocryptographic products may be found at:  
  45. http://www.cisco.com/wwl/export/crypto/tool/stqrg.html  
  46. If you require further assistance pleasecontact us by sending email to  
  47. export@cisco.com.  
  48. cisco WS-C2950-24 (RC32300) processor(revision B0) with 19911K bytes of memory.  
  49. Processor board ID FOC0545X02G  
  50. Last reset from system-reset  
  51. Running Standard Image  
  52. 24 FastEthernet/IEEE 802.3 interface(s)  
  53. 32K bytes of flash-simulated non-volatileconfiguration memory.  
  54. Base ethernet MAC Address: 00:07:EB:85:0A:40  
  55. Motherboard assembly number: 73-5781-08  
  56. Power supply part number: 34-0965-01   
  57. Motherboard serial number: FOC0545034T  
  58. Power supply serial number: PHI054201CT  
  59. Model revision number: B0  
  60. Model number: WS-C2950-24  
  61. System serial number: FOC0545X02G  
  62. PressRETURN to get started!  

7、安装成功后,查看配置,一般都不会丢失,如果没有什么问题,就可以删除之前的IOS文件了。

  1. Switch#delete flash:  
  2. Delete filename []? c2950-i6q4l2-mz.121-22.EA9.bin  
  3. Delete flash:c2950-i6q4l2-mz.121-22.EA9.bin? [confirm]  

大功告成,切记在没有IOS的情况下不要重启交换机,那样就只能用xmodem上传IOS了,很是费时间的差事。

标签:

给我留言