华为路由器配置文件备份与恢复


首先物理机通过桥接和路由器AR1联通

配置AR1和AR2联通
[R1]inter g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.1.1.1 24

[R2]inter g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.1.1.2 24

[R2]ping 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=90 ms
Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

--- 10.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/34/90 ms
在AR1上保存配置
save
The current configuration will be written to the device.
Are you sure to continue? (y/n)[n]:y
It will take several minutes to save configuration file, please wait..........
Configuration file had been saved successfully
Note: The configuration file will take effect after being activated
此时,我们将AR1的当前配置文件稍作修改
user-interface con 0
authentication-mode password
set authentication password cipher 123

我们可以通过compare比较当前配置文件和下次启动配置文件的区别
compare configuration
The current configuration is not the same as the next startup configuration file.
====== Current configuration line 53 ======
set authentication password cipher %$%$g!_Bi;XP*Nvly73KpfP,.4iiAa#,y/7W)wc8yM%CxQV.4l,%$%$`
user-interface vty 0 4
user-interface vty 16 20
====== Configuration file line 53 ======
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
对当前配置文件进行保存,并保存为config.cfg
save config.cfg
Are you sure to save the configuration to config.cfg? (y/n)[n]:y

dir
Directory of flash:/

Idx Attr Size(Byte) Date Time(LMT) FileName
0 drw- - Jan 30 2019 03:08:09 dhcp
1 -rw- 121,802 May 26 2014 09:20:58 portalpage.zip
2 -rw- 1,171 Jan 30 2019 03:51:33 config.cfg
3 -rw- 2,263 Jan 30 2019 03:46:48 statemach.efs
4 -rw- 828,482 May 26 2014 09:20:58 ssl***.zip
5 -rw- 352 Jan 30 2019 03:11:53 private-data.txt
6 -rw- 591 Jan 30 2019 03:46:47 vrpcfg.zip

1,090,732 KB total (784,440 KB free)

我们将R1配置为ftp server,并从客户端将配置文件config.cfg下载下来**
[R1]ftp server enable
aaa
local-user ftp password cipher ftp123
local-user ftp privilege level 15
local-user ftp ftp-directory flash:
local-user ftp service-type ftp
物理机登陆AR1

我们将路由器重启,不保存配置

reboot
Info: The system is comparing the configuration, please wait.
Warning: All the configuration will be saved to the next startup configuration. Continue ? [y/n]:n
System will reboot! Continue ? [y/n]:y
Info: system is rebooting ,please wait...

重启起来的AR1中并没有保存之前在console配置密码的配置

我们通过ftp,将拷贝下来的配置文件再次上传到AR1

并设置引导启动

不保存配置再次重启

起来后,查看console口配置,确认为config.cfg生效

转载于:https://blog.51cto.com/1453735/2347843

你可能感兴趣的:(华为路由器配置文件备份与恢复)