實戰(zhàn)H3C交換機升級固件


一、前言
通常情況下,交換機是非常穩(wěn)定的,但只要是軟件就會有bug,所以設(shè)備廠家都會提供固件的更新,比如我使用的華三交換機,就出現(xiàn)了一些奇奇怪怪的問題,隨即想到升級固件試一下。
二、固件下載
華三交換機固件下載地址在華三官網(wǎng) 首頁-支持-文檔與軟件-軟件下載-交換機
https://www.h3c.com/cn/Service/Document_Software/Software_Download/Switches/
官方提供了下載專用的用戶名密碼
用戶名:yx800
密碼:01230123
注意:華三交換機的系統(tǒng)固件和BootRom已經(jīng)放在一塊了,一次升級即可全部升級。
注意:不同固件的華三命令稍有不同,若命令無法執(zhí)行,用問號?可查看詳細提示。
我的交換機型號為H3C S5120-28P-SI,能夠選擇的最新的固件為H3C S5120SI_E-CMW520-R1519P06,下載該型號并解壓出
S5120SI_E-CMW520-R1519P06.bin
三、TFTP環(huán)境準備
下載3CDaemon漢化版,并配置TFTP服務(wù)

配置服務(wù)目錄

注意:關(guān)閉系統(tǒng)防火墻或添加端口
四、交換機清空配置并直連電腦
清空的目的是為了防止有配置兼容問題
<H3C>reset saved-configuration
The saved configuration file will be erased. Are you sure? [Y/N]:y
Configuration file in flash is being cleared.
Please wait ...
Configuration file is cleared.
<H3C>reboot
Start to check configuration with next startup configuration file, please wait.........DONE!
This command will reboot the device. Current configuration may be lost in next startup if you continue. Continue? [Y/N]:y
System is rebooting now.
為交換機配置vlanip與電腦互聯(lián),電腦IP為192.168.18.2
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]int vlan 1
[H3C-Vlan-interface1]ip add 192.168.18.1 24
[H3C-Vlan-interface1]ping 192.168.18.2
?PING 192.168.18.2: 56 ?data bytes, press CTRL_C to break
? ?Reply from 192.168.18.2: bytes=56 Sequence=1 ttl=64 time=7 ms
? ?Reply from 192.168.18.2: bytes=56 Sequence=2 ttl=64 time=3 ms
? ?Reply from 192.168.18.2: bytes=56 Sequence=3 ttl=64 time=3 ms
? ?Reply from 192.168.18.2: bytes=56 Sequence=4 ttl=64 time=3 ms
?--- 192.168.18.2 ping statistics ---
? ?4 packet(s) transmitted
? ?4 packet(s) received
? ?0.00% packet loss
? ?round-trip min/avg/max = 3/4/7 ms
五、上傳固件
空間充裕
[H3C-Vlan-interface1]quit
[H3C]quit
<H3C>dir
Directory of flash:/
? 0 ? ? -rw- ? ? ? 341 ?Apr 26 2000 12:10:45 ? system.xml
? 1 ? ? -rw- ?10184320 ?Jun 29 2010 14:14:25 ? s5120si-cmw520-r1101p10.bin
? 2 ? ? drw- ? ? ? ? - ?Apr 26 2000 12:00:02 ? logfile
97920 KB total (81690 KB free)
上傳固件
<H3C>tftp 192.168.18.2 get ?S5120SI_E-CMW520-R1519P06.bin
?File will be transferred in binary mode
?Downloading file from remote TFTP server, please wait.../
?TFTP: 14877696 bytes received in 118 second(s)
?File downloaded successfully.
<H3C>dir
Directory of flash:/
? 0 ? ? -rw- ?14877696 ?Apr 26 2000 12:19:55 ? s5120si_e-cmw520-r1519p06.bin
? 1 ? ? -rw- ? ? ? 341 ?Apr 26 2000 12:10:45 ? system.xml
? 2 ? ? -rw- ?10184320 ?Jun 29 2010 14:14:25 ? s5120si-cmw520-r1101p10.bin
? 3 ? ? drw- ? ? ? ? - ?Apr 26 2000 12:00:02 ? logfile
97920 KB total (67158 KB free)
六、安裝固件
配置新固件為第一啟動項
<H3C>boot-loader file flash:/s5120si_e-cmw520-r1519p06.bin main
?This command will set the boot file. Continue? [Y/N]:y
?The specified file will be used as the main boot file at the next reboot on slot 1!
<H3C>reboot
Start to check configuration with next startup configuration file, please wait.........DONE!
This command will reboot the device. Current configuration may be lost in next startup if you continue. Continue? [Y/N]:y
Reboot device by command.
System is rebooting now.
自動安裝固件,全程等待,直至自動進入系統(tǒng)
Starting......
? ?************************************************************************
? ?* ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*
? ?* ? ? ? ? ? ? ? H3C S5120-28P-SI BOOTROM, Version 119 ? ? ? ? ? ? ? ? ?*
? ?* ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*
? ?************************************************************************
? ?Creation Date ? ? ? : Feb ?3 2010
? ?CPU L1 Cache ? ? ? ?: 32KB
? ?CPU Clock Speed ? ? : 333MHz
? ?Memory Size ? ? ? ? : 128MB
? ?Flash Size ? ? ? ? ?: 128MB
? ?CPLD Version ? ? ? ?: 002
? ?PCB Version ? ? ? ? : Ver.B
? ?Mac Address ? ? ? ? : C4CAD99DD5A6
Press Ctrl-B to enter Extended Boot menu...0
Starting to get the main application
file--flash:/s5120si_e-cmw520-r1519p06.bin!....................................
..............................................................................
The main application file is self-decompressing................................
...............................................................................
...............................................................................
............Done!
Extend BootWare Version is not equal,updating? (Y/N):
Updating extended BootRom...Done!
Basic BootWare Version is not equal,updating? (Y/N):
Updating Basic BootRom...Done!
BootWare updated,System is rebooting now.
Starting......
Press Ctrl+D to access BASIC BOOT MENU
Press Ctrl+T to start memory test
********************************************************************************
* ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*
* ? ? ? ? ? ? ? ? ? ?H3C S5120-28P-SI BOOTROM, Version 180 ? ? ? ? ? ? ? ? ? ? *
* ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*
********************************************************************************
Copyright (c) 2004-2017 New H3C Technologies Co., Ltd.
Creation Date ? ? ? : Aug ?9 2017
CPU L1 Cache ? ? ? ?: 32KB
CPU Clock Speed ? ? : 333MHz
Memory Size ? ? ? ? : 128MB
Flash Size ? ? ? ? ?: 128MB
CPLD Version ? ? ? ?: 002
PCB Version ? ? ? ? : Ver.B
Mac Address ? ? ? ? : C4CAD99DD5A6
the normal and back basic is not equal, update back basic....
the normal and back extend is not equal, update back extend....
Press Ctrl-B to enter Extended Boot menu...0
Starting to get the main application file--flash:/s5120si_e-cmw520-r1519p06.bin!
................................................................................
..................................
The main application file is self-decompressing.................................
................................................................................
................................................................................
.........Done!
System is starting...
Startup configuration file does not exist.
It will take a long time to get configuration file, please wait...
Press CTRL_C to break
Retrieving configuration file failed!
User interface aux0 is available.
Press ENTER to get started.
<H3C>
七、刪除舊固件,并為當前交換機保存配置文件
<H3C>del s5120si-cmw520-r1101p10.bin
Delete flash:/s5120si-cmw520-r1101p10.bin?[Y/N]:y
%Delete file flash:/s5120si-cmw520-r1101p10.bin...Done.
<H3C>dir
Directory of flash:/
? 0 ? ? -rw- ? ? ?1617 ?Apr 26 2000 12:01:22 ? startup.cfg
? 1 ? ? -rw- ? ? ? 341 ?Apr 26 2000 12:10:45 ? systembak.xml
? 2 ? ? -rw- ? ? ?7655 ?Apr 26 2000 12:01:20 ? config.cwmp
? 3 ? ? -rw- ?14877696 ?Apr 26 2000 12:19:55 ? s5120si_e-cmw520-r1519p06.bin
? 4 ? ? drw- ? ? ? ? - ?Apr 26 2000 12:00:02 ? logfile
97920 KB total (67142 KB free)
<H3C>save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
flash:/startup.cfg exists, overwrite? [Y/N]:y
Validating file. Please wait....
Saved the current configuration to mainboard device successfully.
Configuration is saved to device successfully.
八、升級完成
如果升級完成后交換機仍有問題,那就扔了吧
