The dhcp server database command enables the function to save the current DHCP data to storage devices.
The undo dhcp server database command disables the function to save the DHCP data to storage devices.
By default, DHCP data is not saved to storage devices.
dhcp server database { enable | recover | write-delay interval }
undo dhcp server database { enable | recover | write-delay }
Parameter |
Description |
Value |
---|---|---|
enable |
Enables the function to save DHCP data to storage devices. |
- |
recover |
Recovers DHCP configurations using DHCP data in storage device. |
- |
write-delay interval |
Specifies the interval at which DHCP data is saved. |
The value is an integer ranging from 300 to 86400, in seconds. The default value is 7200 seconds. |
Usage Scenario
When the device functions as a DHCP server, run the dhcp server database enable command to enable the device to save DHCP data to storage devices. This avoids data loss caused by device faults. Then the system generates lease.txt and conflict.txt files in the storage device. The two files save address lease information and address conflict information respectively. Run the display dhcp server database command to check the storage device for saving DHCP data. After the dhcp server database enable command is run, current DHCP data is automatically saved at the specified interval, and previous data files are overwritten. The interval can be set using the dhcp server database write-delay interval command.
If a fault occurs on the device, run the dhcp server database recover command to recover DHCP data from storage devices during the system restarts.
Prerequisites
The dhcp server database enable command has been run to enable the device to save DHCP data to storage devices, and ensure that the storage devices work properly.
Precautions
The lease.txt and conflict.txt files are overwritten periodically; therefore, you are advised to back up and save the two files to other locations.
# Enable the device to save the current DHCP data to storage devices and set the interval at which DHCP data is saved to 2000s.
<HUAWEI> system-view [HUAWEI] dhcp server database enable [HUAWEI] dhcp server database write-delay 2000
# Recover DHCP configuration using the DHCP data saved on storage devices.
<HUAWEI> system-view [HUAWEI] dhcp server database recover