The dhcp server logging command enables the logging function during IP address allocation of the DHCP server in the interface view.
The undo dhcp server logging command disables the logging function during IP address allocation of the DHCP server in the interface view.
By default, the logging function during IP address allocation of the DHCP server is disabled.
dhcp server logging [ allocation-fail | allocation-success | release | renew-fail | renew-success | detect-conflict | recycle-conflict ] *
undo dhcp server logging [ allocation-fail | allocation-success | release | renew-fail | renew-success | detect-conflict | recycle-conflict ] *
Parameter |
Description |
Value |
---|---|---|
allocation-fail |
Displays logs when address allocation fails. |
- |
allocation-success |
Displays logs when address allocation succeeds. |
- |
release |
Displays logs when addresses are released. |
- |
renew-fail |
Displays logs when address lease renewal fails. |
- |
renew-success |
Displays logs when address lease renewal succeeds. |
- |
detect-conflict |
Displays logs when address conflict occurs. |
- |
recycle-conflict |
Displays logs when conflicting addresses are reclaimed. |
- |
Usage Scenario
This command is used on a DHCP server. When the DHCP server allocates IP addresses to clients, it records address allocation information to facilitate routine maintenance and fault location. After the logging function during IP address allocation of the DHCP server is configured using the dhcp server logging command, the DHCP server records logs about address allocation, conflict, lease renewal, and release.
Run the display ip pool interface interface-pool-name command to check the status of the logging function during IP allocation of the DHCP server.
Prerequisites
IP addresses in the interface address pool have been configured using the ip address command.
The DHCP server function has been enabled on the interface using the dhcp select interface command.
Precautions
For example, the level of logs indicating that an IP address is successfully allocated, an IP address is successfully renewed, and an IP address is successfully released is informational, and these logs are not recorded in the log buffer by default. You can run the info-center source AM channel 4 log level informational command to change the level of the logs to be recorded in the log buffer. You can then run the display logbuffer command to check the preceding logs.
# Enable the logging function during IP address allocation of the DHCP server on the interface VLANIF100.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ip address 192.168.1.1 24 [HUAWEI-Vlanif100] dhcp select interface [HUAWEI-Vlanif100] dhcp server logging
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] ip address 192.168.1.1 24 [HUAWEI-GigabitEthernet0/0/1] dhcp select interface [HUAWEI-GigabitEthernet0/0/1] dhcp server logging