用于引导设备启动的程序文件。MSR系列路由器支持的启动文件如下:
·主用启动文件(main),缺省情况下,设备使用主用启动文件启动设备。
·备用启动文件(backup),当主用启动文件不可用时,设备使用备用启动文件启动设备。
·安全启动文件(secure),当备用启动文件不可用时,设备使用安全启动文件启动设备。如果安全启动文件不可用,系统将提示失败信息。
通常情况下,启动文件是一个后缀名为.bin的文件(例如:main.bin)。
B.2软件升级方式简介升级方式说明通过命令行进行软件升级·需要重启设备来实现设备软件的升级。
·使用该方式升级设备软件时会导致当前业务中断。
通过BootWare菜单升级启动文件可在设备无法正常启动时升级设备软件。
通过Web配置界面升级启动文件通过Web配置界面,为用户提供更加便捷的软件升级方式。
B.3升级前的准备
在升级路由器启动文件前,请完成如下准备工作:
·配置路由器与文件服务器路由可达。
·开启文件服务器的TFTP/FTP Server功能。
·通过配置终端登录到路由器的命令行配置界面中。
·将路由器的升级启动文件拷贝到文件服务器上,并正确设置TFTP/FTP Server的访问路径。
·升级路由器的启动文件后,需要重新启动路由器,在重启过程完成前,路由器的各项业务功能将不可用。
·在BootWare中通过路由器以太网接口升级启动文件时,对于MSR900、MSR 920、MSR20-1X、MSR20-20、MSR20-21、MSR20-24、MSR 30-10、MSR30-11、MSR30-11E、MSR30-11F、MSR 30-16路由器只能使用ETH0接口,对于MSR 930、MSR30-20、MSR30-40、MSR30-60和MSR50-06、MSR50-40、MSR50-60路由器只能使用GE0接口。
各款型路由器用于存储启动文件的存储介质如表11所示:款型存储介质访问路径MSR 900 / 920Flashflash:/
MSR 930Flashflash:/
MSR 20-1XFlashflash:/
MSR 20-20 / 20-21 / 20-40CF卡cfa0:/
MSR 30-10 / 30-11 / 30-11E / 30-11FFlashflash:/
MSR 30-16 / 30-20 / 30-40 / 30-60CF卡cfa0:/
MSR 50-06Flashflash:/
MSR 50-40 / 50-60CF卡cfa0:/
图1路由器的升级环境
B.4.1使用TFTP协议升级路由器的启动文件
路由器作为TFTP Client,访问TFTP文件服务器的制定路径,完成启动文件的备份及升级操作,具体操作步骤如下:
1.备份当前启动文件和配置文件
(1)在命令行配置界面的任意视图下,执行save命令保存路由器当前配置信息:
save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[cfa0:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
cfa0:/startup.cfg exists, overwrite? [Y/N]:y
Validating file. Please wait....
Configuration is saved to device successfully.
(2)在命令行配置界面的用户视图下,执行dir命令查看路由器当前的文件系统,确认启动文件及配置文件名,以及CF卡的剩余空间,保证CF卡有足够空间放入新的启动文件:
dir
Directory of cfa0:/
0 drw- - Jun 28 2011 14:41:16 logfile
1 drw- - Jun 28 2011 14:42:56 domain1
2 -rw- 16256 Jun 28 2011 14:43:40 p2p_default.mtd
3 -rw- 1694 Jun 28 2011 14:47:12 startup.cfg
4 -rw- 3432 Jun 28 2011 14:47:10 system.xml
5 -rw- 23861744 Jun 28 2011 14:37:46 main.bin
252328 KB total (227856 KB free)
File system type of cfa0: FAT16
路由器出厂时,缺省的启动文件名为main.bin,用户保存路由器配置信息后,缺省的配置文件名为startup.cfg。CF卡剩余存储空间约为220 MB(227856 KB)。
(3)在命令行配置界面的用户视图下,执行tftp put命令将启动文件main.bin备份到TFTP文件服务器上:
tftp 192.168.1.1 put main.bin
File will be transferred in binary mode
Sending file to remote TFTP server. Please wait... \
TFTP: 23861744 bytes sent in 70 second(s).
File uploaded successfully.
(4)在命令行配置界面的用户视图下,执行tftp put命令将配置文件startup.cfg备份到TFTP文件服务器上:
tftp 192.168.1.1 put startup.cfg
File will be transferred in binary mode
Sending file to remote TFTP server. Please wait... \
TFTP: 1694 bytes sent in 0 second(s).
File uploaded successfully.
2.升级启动文件
(1)在命令行配置界面的用户视图下,执行tftp get命令将启动文件MSR30-CMW520-R2207P02-SI.BIN导入到路由器的CF卡中:
tftp 192.168.1.1 get MSR30-CMW520-R2207P02-SI.BIN
File will be transferred in binary mode
Downloading file from remote TFTP server, please wait...|
TFTP: 23861744 bytes received in 70 second(s)
File downloaded successfully.
(2)在命令行配置界面的用户视图下,执行boot-loader命令设置路由器下次启动使用的启动文件为MSR30-CMW520-R2207P02-SI.BIN,并指定启动文件类型为main:
boot-loader file msr30-cmw520-r2207p02-si.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 0!
(3)在命令行配置界面的用户视图下,执行display boot-loader命令查看设备的启动程序文件信息:
display boot-loader
The boot file used at this reboot:cfa0:/main.bin attribute: main
The boot file used at the next reboot:cfa0:/msr30-cmw520-r2207p02-si.bin attribute: main
Failed to get the backup boot file used at the next reboot!
Failed to get the secure boot file used at the next reboot!
如上显示信息中,下一次启动的程序文件已经设置为MSR30-CMW520-R2207P02-SI.BIN。
(4)在命令行配置界面的用户视图下,执行reboot命令重启路由器:
reboot
Start to check configuration with next startup configuration file, please wait.........DONE!
This command will reboot the device. Continue? [Y/N]:y
#Aug 16 15:40:26:623 2011 MSR30-20 DEVM/1/REBOOT:
Reboot device by command.
%Aug 16 15:40:26:623 2011 MSR30-20 DEVM/5/SYSTEM_REBOOT: System is rebooting now.
Now rebooting, please wait...
System is starting...
(5)路由器重启后,通过display version命令查看路由器的启动文件版本信息是否与升级的启动文件一致。
display version
Comware Software, Version 5.20, Release 2207P02, Standard
Copyright (c) 2004-2011 Hangzhou H3C Tech. Co., Ltd. All rights reserved.
H3C MSR30-20 uptime is 0 week, 0 day, 4 hours, 24 minutes
Last reboot 2011/08/16 09:57:05
System returned to ROM By Command.
CPU type: FREESCALE MPC8349 533MHz
256M bytes DDR SDRAM Memory
4M bytes Flash Memory
Pcb Version: 3.0
Logic Version: 2.0
Basic BootROM Version: 3.12
Extended BootROM Version: 3.13
[SLOT 0]CON (Hardware)3.0 (Driver)1.0, (Cpld)2.0
[SLOT 0]AUX (Hardware)3.0 (Driver)1.0, (Cpld)2.0
[SLOT 0]GE0/0 (Hardware)3.0 (Driver)1.0, (Cpld)2.0
[SLOT 0]GE0/1 (Hardware)3.0 (Driver)1.0, (Cpld)2.0
[SLOT 0]CELLULAR0/0 (Hardware)3.0 (Driver)1.0, (Cpld)2.0
B.4.2使用FTP协议升级路由器的启动文件
路由器作为FTP Client,访问FTP文件服务器的指定路径,完成启动文件的备份及升级操作,具体操作步骤如下:
1.备份当前启动文件和配置文件
(1)在命令行配置界面的任意视图下,执行save命令保存路由器当前配置信息:
save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[cfa0:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
cfa0:/startup.cfg exists, overwrite? [Y/N]:y
Validating file. Please wait....
Configuration is saved to device successfully.
(2)在命令行配置界面的用户视图下,路由器行dir命令查看路由器当前的文件系统,确认启动文件及配置文件名,以及CF卡的剩余空间,保证CF卡有足够空间放入新的启动文件:
dir
Directory of cfa0:/
0 drw- - Jun 28 2011 14:41:16 logfile
1 drw- - Jun 28 2011 14:42:56 domain1
2 -rw- 16256 Jun 28 2011 14:43:40 p2p_default.mtd
3 -rw- 1694 Jun 28 2011 14:47:12 startup.cfg
4 -rw- 3432 Jun 28 2011 14:47:10 system.xml
5 -rw- 23861744 Jun 28 2011 14:37:46 main.bin
252328 KB total (227856 KB free)
File system type of cfa0: FAT16
路由器出厂时,缺省的启动文件名为main.bin,用户保存路由器配置信息后,缺省的配置文件名为startup.cfg。CF卡剩余存储空间约为220 MB(227856 KB)。
(3)在命令行配置界面的用户视图下,执行ftp命令登录FTP文件服务器,根据系统提示输入登录用户名和密码:
ftp 192.168.1.1
Trying 192.168.1.1 ...
Press CTRL+K to abort
Connected to 192.168.1.1.
220 3Com 3CDaemon FTP Server Version 2.0
User(192.168.1.100:(none)):user001
331 User name ok, need password
Password:
230 User logged in
(4)在FTP客户端视图下,执行put命令将启动文件main.bin备份到FTP文件服务器上:
[ftp] put main.bin
227 Entering passive mode (192,168,1,1,7,210)
125 Using existing data connection
226 Closing data connection; File transfer successful.
FTP: 23861744 byte(s) sent in 21.363 second(s), 1116.00Kbyte(s)/sec.
[ftp]
(5)在FTP客户端视图下,执行put命令将配置文件startup.cfg备份到FTP文件服务器上:
[ftp] put startup.cfg
227 Entering passive mode (192,168,1,1,7,177)
125 Using existing data connection
226 Closing data connection; File transfer successful.
FTP: 1677 byte(s) sent in 0.142 second(s), 11.00Kbyte(s)/sec.
[ftp]
2.升级启动文件
(1)在FTP客户端视图下,执行get命令将启动文件MSR30-CMW520-R2207P02-SI.BIN导入到路由器的CF卡中:
[ftp] get msr30-cmw520-r2207p02-si.bin
227 Entering passive mode (192,168,1,1,7,225)
125 Using existing data connection