實(shí)驗(yàn)拓?fù)?/h1>
image.png
實(shí)驗(yàn)需求
1.按照?qǐng)D示連接到真機(jī)乓搬,并配置IP地址(真機(jī)IP地址配置到VirtualBox Host-Only Ethernet Adapter網(wǎng)卡)
2.R1保存當(dāng)前配置
3.在R1上開啟FTP服務(wù)
4.使用真機(jī)訪問FTP服務(wù)胖秒,把R1的配置文件拷貝到本地
5.在R1上清空配置杨何,重啟R1灌闺,確認(rèn)已配置為空配狀態(tài)
6.再次在R1開啟FTP服務(wù),并把真機(jī)拷貝的配置文件還原到路由器
7.更改R1的啟動(dòng)配置文件名
8.再次重啟R1,確認(rèn)配置已還原
實(shí)驗(yàn)解法
1.配置IP地址部分略
2.R1保存當(dāng)前配置剑刑,并確認(rèn),命令如下
[R1]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):
Validating file. Please wait...
Configuration is saved to device successfully.
3.R1上開啟FTP服務(wù)双肤,創(chuàng)建用戶wangdaye施掏,密碼123
步驟1:開啟FTP服務(wù)
[R1]ftp server enable
步驟2:創(chuàng)建用于FTP身份驗(yàn)證的用戶,配置密碼茅糜,并設(shè)置用戶權(quán)限級(jí)別和服務(wù)類型
[R1]local-user wangdaye class manage
New local user added.
[R1-luser-manage-wangdaye]password simple 123456
[R1-luser-manage-wangdaye]authorization-attribute user-role level-15
[R1-luser-manage-wangdaye]service-type ftp
4.使用真機(jī)訪問FTP服務(wù)七芭,備份R1的配置文件
步驟1:使用資源管理器訪問FTP服務(wù),如圖1-2所示
步驟2:輸入用戶名和密碼蔑赘,如圖1-3所示
步驟3:復(fù)制R1的配置文件抖苦,如圖1-4所示
5.在R1上清空配置,命令如下
分析:此時(shí)R1的配置已經(jīng)備份到PC上米死,現(xiàn)在把R1的配置清空锌历,再測(cè)試還原備份的配置是否有效
<R1>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.
6.重啟R1,命令如下
注意:重啟設(shè)備時(shí)峦筒,第一次確認(rèn)提示是設(shè)備檢測(cè)到配置被清空究西,詢問是否要重新保存當(dāng)前配置。此次詢問需要輸入n來否定卤材;第二次確認(rèn)提示才是詢問是否確認(rèn)要重啟,應(yīng)該輸入y
<R1>reboot
Start to check configuration with next startup configuration file, please wait.........DONE!
Current configuration may be lost after the reboot, save current configuration? [Y/N]:n
This command will reboot the device. Continue? [Y/N]:y
Now rebooting, please wait...
7.查看R1配置峦失,發(fā)現(xiàn)R1的配置已經(jīng)變成空配狀態(tài)
<H3C>display current-configuration
#
version 7.1.075, Alpha 7571
#
sysname H3C
#
system-working-mode standard
xbar load-single
password-recovery enable
lpu-type f-series
#
vlan 1
8.再次把R1的g0/0口配置IP地址扇丛,并開啟FTP,命令略
9.把真機(jī)上的配置文件還原到路由器尉辑,過程略
10.更改R1的啟動(dòng)配置文件名帆精,命令如下
<H3C>startup saved-configuration startup.cfg
Please wait...... Done.
11.重啟R1,確認(rèn)配置已經(jīng)還原到清空前的狀態(tài)
<R1>display cu
<R1>display current-configuration
#
version 7.1.075, Alpha 7571
#
sysname R1
#
system-working-mode standard
xbar load-single
password-recovery enable
lpu-type f-series
#
vlan 1