华为交换机怎么保存配置
问题描述
交换机做完配置之后怎么保存配置,以防止异常断电或者重启之后配置丢失?
解决方案
save命令用来保存当前配置信息到系统默认的存储路径中。
save命令需要在用户视图配置,可以接以下参数:
参数 | 参数说明 | 取值 |
---|---|---|
all | 保存所有的配置,包括不在位的板卡的配置。 | - |
configuration-file | 配置文件的文件名。 | 字符串形式,不支持空格,不区分大小写,绝对路径的长度范围是5~64。 |
注意事项
-
该命令为覆盖式命令,如果保存时文件名已经存在,原文件的内容将被替换。
-
配置文件必须以*.zip或者*.cfg作为扩展名,其中:
- *.cfg为纯文本格式,可直接查看其内容。指定为配置文件后,启动时系统对里面的命令逐条进行恢复。
- *.zip是*.cfg的压缩,占用空间较小。指定为配置文件后,启动时先解压成*.cfg格式,然后逐条恢复。
# 保存当前配置文件到默认存储设备中,系统默认的配置文件名为vrpcfg.zip
<HUAWEI> save
The current configuration will be written to the device. Are you sure to continue?[Y/N]y Now saving the current configuration to the slot 0.. Save the configuration successfully.
#不使用默认的配置名保存配置,保存的配置文件名为test.zip
<Quidway>save test.zip
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Jan 1 2008 09:43:11+08:00 Quidway %%01CFM/4/SAVE(l)[0]:The user chose Y when de
ciding whether to save the configuration to the device.
Jan 1 2008 09:43:11+08:00 Quidway %%01CFM/4/SAVE_FILE(l)[1]:When deciding wheth
er to save the configuration to the file flash:/test.zip, the user chose Y.
Now saving the current configuration to the slot 0 .
Info: Save the configuration successfully.
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Jan 1 2008 09:43:11+08:00 Quidway %%01CFM/4/SAVE(l)[0]:The user chose Y when de
ciding whether to save the configuration to the device.
Jan 1 2008 09:43:11+08:00 Quidway %%01CFM/4/SAVE_FILE(l)[1]:When deciding wheth
er to save the configuration to the file flash:/test.zip, the user chose Y.
Now saving the current configuration to the slot 0 .
Info: Save the configuration successfully.
例:保存的配置文件名为20220831cfg-bk.zip, 保存效果如下