|
设备中的配置文件分为两种类型:当前配置文件和保存的配置文件。当前配置文件存储在 RAM 中,保存的配置文件存放在 FLASH 里。
显示当前配置文件: display current-configuration
显示保存的配置文件: display saved-configuration
查看系统启动配置参数: display startup
比如在执行 saved 后,在运行 display startup 命令可以看到:
<Huawei>display startup
MainBoard:
Configured startup system software: NULL
Startup system software: NULL
Next startup system software: NULL
Startup saved-configuration file: NULL
Next startup saved-configuration file: flash:/vrpcfg.zip
Startup paf file: NULL
Next startup paf file: NULL
Startup license file: NULL
Next startup license file: NULL
Startup patch package: NULL
Next startup patch package: NULL
<Huawei>
也就是说,在系统下次启动时,就会去执行保存的配置文件,默认这个保存的文件名就是 vrpcfg.zip 。当然,我们也可以手动去指定系统在启动时执行的配置文件,比如:
/*做实验用,先复制一个配置文件出来*/
<Huawei>copy vrpcfg.zip another-vrpcfg.zip
Copy flash:/vrpcfg.zip to flash:/another-vrpcfg.zip?[Y/N]:y
100% complete
Info: Copied file flash:/vrpcfg.zip to flash:/another-vrpcfg.zip...Done.
/*指定执行上面复制出来的配置文件*/
<Huawei>startup saved-configuration flash:/another-vrpcfg.zip
Info: Succeeded in setting the configuration for booting system.
/*在看一下 startup 时的参数配置情况*/
<Huawei>disp startup
MainBoard:
Configured startup system software: NULL
Startup system software: NULL
Next startup system software: NULL
Startup saved-configuration file: NULL
Next startup saved-configuration file: flash:/another-vrpcfg.zip
Startup paf file: NULL
Next startup paf file: NULL
Startup license file: NULL
Next startup license file: NULL
Startup patch package: NULL
Next startup patch package: NULL
可以看到,启动时执行的配置文件改变了。
删除 flash 中的配置文件很简单,命令为:
还有一条命令同样效果:
reset saved-configuration
在用 reset 命令删除配置文件后,如果执行 dir 查看,缺发现 vrpcfg.zip 这个配置文件还在。注意,vrpcfg.zip 是个压缩文件,里头被压缩的配置文件实际已经被清除,这个可以执行 display saved-configuration 来验证一下。
如果我们对系统又重新配置了一番,且又想看看现在修改的内容和之前已经保存的内容有何不同,那么可以执行命令 compare configuration 进行查看。比如现在修改了设备名:
然后执行比较命令,就可以看到:
<SW1>compare configuration
Warning: The current configuration is not the same as the next startup configura
tion file. There may be several differences, and the following are some configur
ations beginning from the first:
====== Current configuration line 2 ======
sysname SW1
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
====== Configuration file line 2 ======
sysname Huawei
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
|
|