一:備份配置文件
設備作為FTP服務器,用戶PC作為FTP客戶端
# 配置設備的FTP功能及FTP用戶信息。
<HUAWEI> system-view
[HUAWEI] ftp server enable
[HUAWEI] aaa
[HUAWEI-aaa] local-user admin1234 password irreversible-cipher Helloworld@6789
[HUAWEI-aaa] local-user admin1234 privilege level 15
[HUAWEI-aaa] local-user admin1234 service-type ftp
[HUAWEI-aaa] local-user admin1234 ftp-directory cfcard:/ //這里注意是你交換機當前目錄dir
[HUAWEI-aaa] quit
[HUAWEI] quit
# 保存設備當前配置。
<HUAWEI> save
# 從終端PC通過FTP連接設備,輸入用戶名admin1234和密碼Helloworld@6789,並采用binary模式進行文件傳輸。
終端以Window win7操作系統為例說明。
C:\Documents and Settings\Administrator> ftp 10.136.23.5
Connected to 10.136.23.5.
220 FTP service ready.
User (10.136.23.5:(none)): admin1234
331 Password required for admin1234.
Password:
230 User logged in.
ftp> binary
200 Type set to I.
ftp>
# 備份配置文件。
ftp> get vrpcfg.zip
200 Port command okay.
150 Opening BINARY mode data connection for vrpcfg.zip.
226 Transfer complete.
ftp: 收到 1257 字節,用時 0.03秒 40.55千字節/秒。
設置恢復的配置文件為下次啟動配置文件並重啟設備
C:\Users\Administrator>這是備份的配置文件的默認路徑
至此備份成功
二:恢復配置文件
設備作為FTP服務器,本地PC作為FTP客戶端,將備份的配置文件上傳到設備中
# 配置設備的FTP服務器功能及FTP用戶信息。
<HUAWEI> system-view
[HUAWEI] ftp server enable
[HUAWEI] aaa
[HUAWEI-aaa] local-user admin1234 password irreversible-cipher Helloworld@6789
[HUAWEI-aaa] local-user admin1234 privilege level 15
[HUAWEI-aaa] local-user admin1234 service-type ftp
[HUAWEI-aaa] local-user admin1234 ftp-directory cfcard:/
[HUAWEI-aaa] quit
[HUAWEI] quit
# 從終端PC通過FTP連接設備,輸入用戶名admin1234和密碼Helloworld@6789,並采用binary模式進行文件傳輸。
終端以Window XP操作系統為例說明。
C:\Documents and Settings\Administrator> ftp 10.136.23.5
Connected to 10.136.23.5.
220 FTP service ready.
User (10.136.23.5:(none)): admin1234
331 Password required for admin1234.
Password:
230 User logged in.
ftp> binary
200 Type set to I.
ftp>
# 上傳備份的配置文件到設備中。
ftp> put vrpcfg.zip
200 Port command okay.
150 Opening BINARY mode data connection for vrpcfg.zip.
226 Transfer complete.
ftp: 發送 1257 字節,用時 0.03秒 40.55千字節/秒。
至此上傳配置文件成功了
dir命令查看是否上傳成功了
設置恢復的配置文件為下次啟動配置文件並重啟設備
<HUAWEI> startup saved-configuration config.cfg
<HUAWEI> display startup
MainBoard:
Configured startup system software: cfcard:/device_software.cc
Startup system software: cfcard:/device_software.cc
Next startup system software: cfcard:/device_software.cc
Startup saved-configuration file: cfcard:/config_old.cfg //設備當前的配置文件名。
Next startup saved-configuration file: cfcard:/config.cfg //下次啟動的配置文件名。
Startup paf file: default
Next startup paf file: default
Startup license file: default
Next startup license file: default
Startup patch package: NULL
Next startup patch package: NULL
<HUAWEI> reboot //重啟設備。
Info: The system is now comparing the configuration, please wait.
Warning: The configuration has been modified, and it will be saved to the next startup saved-configuration file cfcard:/config.cfg. Continue? [Y/N]:N //輸入N防止設備當前的配置保存到備份的配置文件中。
Now saving the current configuration to the slot 13.
Save the configuration successfully.
Info: If want to reboot with saving diagnostic information, input 'N' and then execute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:Y //輸入Y重啟設備。
以上是參照華為文檔,親測