曲径通幽论坛

 找回密码
 立即注册
搜索
查看: 2860|回复: 0
打印 上一主题 下一主题

[华为] 配置文件管理

[复制链接]

4918

主题

5880

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34387
跳转到指定楼层
楼主
发表于 2016-1-30 02:13:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
设备中的配置文件分为两种类型:当前配置文件和保存的配置文件。当前配置文件存储在 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 中的配置文件很简单,命令为:
delete flash:/vrpcfg.zip

还有一条命令同样效果:
reset saved-configuration

在用 reset 命令删除配置文件后,如果执行 dir 查看,缺发现 vrpcfg.zip 这个配置文件还在。注意,vrpcfg.zip 是个压缩文件,里头被压缩的配置文件实际已经被清除,这个可以执行 display saved-configuration 来验证一下。

如果我们对系统又重新配置了一番,且又想看看现在修改的内容和之前已经保存的内容有何不同,那么可以执行命令 compare configuration 进行查看。比如现在修改了设备名:
[Huawei]sysname SW1


然后执行比较命令,就可以看到:
<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


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )

GMT+8, 2024-5-25 08:37 , Processed in 0.065220 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表