< Home

dhcp server database

Function

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.

Format

dhcp server database { enable | recover | write-delay interval }

undo dhcp server database { enable | recover | write-delay }

Parameters

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.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

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.

  • The time displayed in the lease.txt and conflict.txt files is the UTC time rather than the system time, and you do not need to pay attention to time zone information.
  • During the interval, if the device restarts unexpectedly, DHCP data generated at the interval are lost. Users can only recover the last successfully saved DHCP data from storage device files.

Example

# 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >