通过TFTP服务器对H3C MSR 900路由器的维护
1、配置环境
将Ethernet 0/0口与一台PC用交叉以太网线相连。在PC上启动TFTP/FTP程序做为服务器,并设置TFTP/FTP服务器的路径指向应用程序所在地址,如果是采用FTP服务器还需要设置用户名和密码。
配置两边IP地址为同一网络,本节在TFTP服务器端设置为192.168.1.1,与其相连的路由器以太网口(本例为Ethernet 0/0,任何以太网口均可)设置为192.168.1.2。双方可以用ping命令检验是否连接成功。
2、

3、备份、恢复应用程序、配置文件
在环境搭建好后,请在终端上做如下操作:
通过dir命令我们可以查看当前文件系统包含了哪些文件:
dir
Directory of flash:/
0 -rw- 15801497 Jan 01 2007 00:14:35 main.bin
1 -rw- 9187 Jan 01 2007 00:12:23 config.cwmp
2 -rw- 139 Jan 01 2007 00:05:39 system.xml
3 -rw- 800 Jan 01 2007 00:12:28 startup.cfg
31369 KB total (15921 KB free)
如果我们要把路由器上的startup.cfg文件备份到TFTP服务器上,并保存为startup.bak可以用如下命令:
tftp 192.168.1.1 put startup.cfg startup.bak
File will be transferred in binary mode
Sending file to remote tftp server. Please wait... \
TFTP: 1045 bytes sent in 0 second(s).
File uploaded successfully.
从服务器上把服务器上的startup.cfg文件下载到路由器上的命令为:
tftp 192.168.1.1 get startup.cfg startup.cfg
The file startup.cfg exists. Overwrite it?[Y/N]:y
Verifying server file...
Deleting the old file, please wait...
File will be transferred in binary mode
Downloading file from remote tftp server, please wait...\
TFTP: 1045 bytes received in 0 second(s)
File downloaded successfully.
如果路由器上已经有一个同名文件系统会提示是否覆盖,选择确认。
4、升级应用程序
在环境搭建好后,请在设备上做如下操作:(以应用程序的文件名为msr.bin为例)
通过save命令保存当前配置:
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):
通过dir命令查看应用程序文件和Flash的剩余空间(保证Flash卡有足够空间放入新的应用程序):
dir
Directory of flash:/
0 -rw- 15801497 Jan 01 2007 00:14:35 main.bin
1 -rw- 9187 Jan 01 2007 00:12:23 config.cwmp
2 -rw- 139 Jan 01 2007 00:05:39 system.xml
3 -rw- 800 Jan 01 2007 00:12:28 startup.cfg
31369 KB total (15921 KB free)
通过TFTP将应用程序msr.bin导入设备的CF卡中:
tftp 192.168.1.2 get msr.bin
File will be transferred in binary mode
Downloading file from remote TFTP server, please wait...\
TFTP: 15054340 bytes received in 34 second(s)
File downloaded successfully.
通过boot-loader命令设置下次启动使用的应用程序为msr.bin:
boot-loader file flash:/msr.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!
通过display boot-loader命令查看设备的启动文件信息:
dis boot-loader
The boot file used at this reboot: flash:/main.bin attribute: main
The boot file used at the next reboot:flash:/msr.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!
确定设置的启动文件正确,然后通过reboot命令重启设备:
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
设备重启完毕,通过display boot-loader命令查看设备的启动文件信息,保证设备当前使用应用程序为msr.bin。