Bootstrap

ENSP常用清除配置命令及保存命令

一、清除整个交换机或路由器配置命令

在用户视图下执行reset saved-configuration,然后使用reboot命令重启路由器即可。

在配置reset saved-configuration命令后,重启设备时请选择不保存当前配置文件。

清除和重新配置的信息只能在设备重新启动后生效,当前配置不变。

依次输入命令:reset saved-configuration —>Y—>reboot—>N—>Y

<SW2>reset  saved-configuration 
Warning: The action will delete the saved configuration in the device.
The configuration will be erased to reconfigure. Continue? [Y/N]:y
Warning: Now clearing the configuration in the device.
Dec 25 2024 10:43:05-08:00 SW2 %%01CFM/4/RST_CFG(l)[2]:The user chose Y when dec
iding whether to reset the saved configuration.
Info: Succeeded in clearing the configuration in the device.

<SW2>reboot
Info: The system is now comparing the configuration, please wait.
Warning: All the configuration will be saved to the configuration file for the n
ext startup:, Continue?[Y/N]:n     #此时要选择n,若选择y则之前的配置会保存,重启后仍然是原来的配置。 
Info: If want to reboot with saving diagnostic information, input 'N' and then e
xecute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:y
Dec 25 2024 10:45:17-08:00 SW2 %%01CMD/4/REBOOT(l)[4]:The user chose Y when deci
ding whether to reboot the system. (Task=co0, Ip=**, User=**)

二、save命令保存配置

<SW2>save            #用户视图输入save命令
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y  #按提示输入y,回车
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Dec 25 2024 10:39:16-08:00 SW2 %%01CFM/4/SAVE(l)[1]:The user chose Y when decidi
ng whether to save the configuration to the device.  #再次回车
Now saving the current configuration to the slot 0.
Save the configuration successfully.  #提示保存成功

三、显示设备配置

[SW1]display current-configuration 
#
sysname SW1
#
vlan batch 2 to 5
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
... ...

四、清除交换机或路由器某个端口地配置命令

<huawei>system-view
[huawei]interface gigabitethernet 0/0/? (?:表示第几个端口)
[huawei-GigabitEthernet0/0/?]clear configuration interface gigabitethernet 0/0/?
清除该端口的配置后,该端口处于关闭状态,可以用以下命令重新开启。
[huawei-GigabitEthernet0/0/?]undo shutdown
;