实验拓扑
实验需求
- 按照图示连接到真机,并配置IP地址(真机IP地址配置到VirtualBox Host-Only Ethernet Adapter网卡)
- R1保存当前配置
- 在R1上开启FTP服务
- 使用真机访问FTP服务,把R1的配置文件拷贝到本地
- 在R1上清空配置,重启R1,确认已配置为空配状态
- 再次在R1开启FTP服务,并把真机拷贝的配置文件还原到路由器
- 更改R1的启动配置文件名
- 再次重启R1,确认配置已还原
实验步骤
1.配置IP地址
[H3C]sysn R1
[R1]int g0/0
[R1-GigabitEthernet0/0]ip add 192.168.56.2 24
2.R1保存当前配置,并确认
[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服务,创建用户wangdaye,密码qwe1234567
[R1]ftp server enable
[R1]local-user wangdaye class manage
New local user added.
[R1-luser-manage-wangdaye]password simple qwe1234567
[R1-luser-manage-wangdaye]authorization-attribute user-role level-15
[R1-luser-manage-wangdaye]service-type ftp
4.使用真机访问FTP服务,备份R1的配置文件
将文件可以先复制到桌面
5.在R1上清空配置
分析:此时R1的配置已经备份到PC上,现在把R1的配置清空,再测试还原备份的配置是否有效
<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
注意:重启设备时,第一次确认提示是设备检测到配置被清空,询问是否要重新保存当前配置。此次询问需要输入n
来否定;第二次确认提示才是询问是否确认要重启,应该输入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配置,发现R1配置已经清空
<H3C>dis cu
#
version 7.1.064, Release 0427P22
#
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.把真机上的配置文件还原到路由器
10.更改R1的启动配置文件名
<H3C>startup saved-configuration startup.cfg
Please wait...... Done.
11.重启R1,确认配置已经还原到清空前的状态
<R1>dis cu
#
version 7.1.064, Release 0427P22
#
sysname R1
#
system-working-mode standard
xbar load-single
password-recovery enable
lpu-type f-series
#
vlan 1