华为:dhcp server database命令用来开启将当前DHCP数据保存到存储设备的功能。

华为:dhcp server database命令用来开启将当前DHCP数据保存到存储设备的功能。

[SW1]dhcp server database enable

应用场景
设备作为DHCP服务器时,为防止设备发生意外导致数据丢失,用户可以使用dhcp server database enable命令启用DHCP数据保存功能,系统将生成lease.txt和conflict.txt两个文件存放在存储器的DHCP文件夹中,分别保存正常的地址租借信息和地址冲突信息。
(执行命令display dhcp server database可以查看DHCP数据保存的存储器路径。)系统每隔一定时间自动保存一次当前的DHCP数据,并覆盖之前的数据文件,这个时间间隔可以通过dhcp server database write-delay interval命令设置。
如果设备发生故障时,用户使用dhcp server database recover命令,可以在系统重启后从存储设备文件恢复DHCP数据。

前置条件
保存信息之前需要先执行dhcp server database enable命令,启动DHCP数据保存到存储设备的功能,并且确认存储设备正常运行。
注意事项
lease.txt和conflict.txt这两个文件会被定期覆盖,建议用户在必要时将生成的文件备份到其他位置。
lease.txt和conflict.txt这两个文件显示的时间为UTC时间,非系统时间,不关注时区信息。


图片.png

使用实例
# 开启DHCP数据保存到存储设备的功能,并配置保存时延为2000秒。
<HUAWEI> system-view
[HUAWEI] dhcp server database enable
[HUAWEI] dhcp server database write-delay 2000

图片.png


# 开启从存储设备恢复DHCP数据的功能。
<HUAWEI> system-view
[HUAWEI] dhcp server database recover



(1)拓扑图

图片.png

(2)基本配置

vlan batch 10

ip pool pool10
 gateway-list 192.168.10.254
 network 192.168.10.0 mask 255.255.255.0
 static-bind ip-address 192.168.10.4 mac-address 5489-98ad-0808
 excluded-ip-address 192.168.10.5 192.168.10.253
 dns-list 223.5.5.5 223.6.6.6    
 
 interface Vlanif10
 ip address 192.168.10.254 255.255.255.0
 dhcp select global


图片.png


保存配置并重启:

图片.png

交换机重启后:IP冲突了

图片.png

[sw1]dhcp server database enable
Info: The operation may take a few seconds, please wait.
done.
[sw1]

[sw1]dhcp server database write-delay 300

图片.png

[sw1]undo dhcp server database enable
[sw1]undo dhcp server database recover
[sw1]undo dhcp server database write-delay
<sw1>dir
Directory of flash:/
  Idx  Attr     Size(Byte)  Date        Time       FileName
    0  drw-              -  Aug 06 2015 21:26:42   src
    1  drw-              -  Nov 29 2022 10:29:48   compatible
    2  drw-              -  Nov 29 2022 15:10:28   dhcp
    3  -rw-            679  Nov 29 2022 16:44:25   vrpcfg.zip
32,004 KB total (31,956 KB free)
<sw1>


<sw1>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.
Nov 29 2022 16:49:09-08:00 sw1 %%01CFM/4/SAVE(l)[59]:The user chose Y when deciding whether to save the configuration to the device.
Save the configuration successfully.
<sw1>
<sw1>
<sw1>
<sw1>reboot
Info: The system is now comparing the configuration, please wait.
Info: If want to reboot with saving diagnostic information, input 'N' and then execute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:y

图片.png



DHCP服务器与MAC地址绑定、snooping(列表、list、全)maclist、dhcplist、dhcpsnoopinglist
http://www.zh-cjh.com/wenzhangguilei/1005.html
文章归类、所有文章列表、LISTLIST
http://www.zh-cjh.com/wangzhangonggao/2195.html

1、本站资源长期持续更新。
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。

转载请保留出处:  www.zh-cjh.com珠海陈坚浩博客 » 华为:dhcp server database命令用来开启将当前DHCP数据保存到存储设备的功能。

作者: cjh


手机扫一扫,手机上查看此文章:

一切源于价值!

其他 模板文件不存在: ./template/plugins/comment/pc/index.htm

未雨绸缪、居安思危!

数据安全、有备无患!

注意操作、数据无价!

一切源于价值!