cisco 设备配置文件的保存和恢复

cisco 配置文件的保存和恢复

记录cisco交换机设备配置文件的保存与恢复,附加h3c设备的操作命令,华为网络设备与h3c类似。

保存配置文件

思科保存配置文件目录结构大概如下:

1
2
3
4
5
6
7
8
9
R1#dir
Directory of nvram:/

508 -rw- 2190 <no date> startup-config
509 ---- 24 <no date> private-config
510 -rw- 2190 <no date> underlying-config
1 ---- 34 <no date> persistent-data
2 -rw- 4 <no date> rf_cold_starts
3 -rw- 0 <no date> ifIndex-table

启动配置文件为start-config

要保存当前配置文件的逻辑是先备份当前的启动文件startup-config

1
2
3
4
R1#copy startup-config nvram:20190826.backup
Destination filename [20190826.backup]?

2190 bytes copied in 1.136 secs (1928 bytes/sec)

保存的配置文件如下:

1
2
3
4
5
6
7
8
9
10
11
12
R1#dir
Directory of nvram:/

508 -rw- 2190 <no date> startup-config
509 ---- 24 <no date> private-config
510 -rw- 2190 <no date> underlying-config
1 ---- 34 <no date> persistent-data
2 -rw- 4 <no date> rf_cold_starts
3 -rw- 0 <no date> ifIndex-table
4 -rw- 2190 <no date> 20190826.backup

522232 bytes total (513822 bytes free)

将当前配置保存为启动配置

1
2
3
4
R1#copy running-config nvram:startup-config
Destination filename [startup-config]?
Building configuration...
[OK]

恢复配置文件

例如恢复到20190826的配置

1
2
3
4
R1#copy nvram:/20190826.backup startup-config
Destination filename [startup-config]? y

2190 bytes copied in 1.108 secs (1977 bytes/sec)

重启交换机,不需要保存运行中的配置:

1
2
3
4
5
R1#reload 
Proceed with reload? [confirm]y
*Jul 27 02:14:18.199: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

ROM: reload requested...

H3C 化为的操作思路

保存文件,选用配置

1
2
3
4
5
<F1070>save 20190828.cfg
The current configuration will be saved to flash:/20190828.cfg. Continue? [Y/N]:y
Now saving current configuration to the device.
Saving configuration flash:/20190828.cfg.Please wait...
Configuration is saved to device successfully.

配置启动项:

1
2
<F1070>startup saved-configuration 20190828.cfg 
Please wait...... Done.

cisco 设备配置文件的保存和恢复
https://ywmy.xyz/2019/07/27/cisco-设备配置文件的保存和恢复/
作者
ian
发布于
2019年7月27日
许可协议