The dhcp server expired command sets the lease for IP addresses in an interface IP address pool.
By default, the lease of IP addresses is one day.
Parameter |
Description |
Value |
---|---|---|
day |
Specifies the number of days in the IP address lease. |
The value is an integer ranging from 0 to 999, in days. The default value is 1. |
hour |
Specifies the number of hours in the IP address lease. |
The value is an integer ranging from 0 to 23, in hours. The default value is 0. |
minute |
Specifies the number of minutes in the IP address lease. |
The value is an integer ranging from 0 to 59, in minutes. The default value is 0. |
unlimited |
Indicates that the IP address lease is unlimited. |
- |
Usage Scenario
The dhcp server expired command applies to DHCP servers. To meet different client requirements, DHCP supports dynamic, automatic, and static address assignment. Different hosts require different IP address leases. For example, if some hosts such as a DNS server need to use certain IP addresses for a long time, run the dhcp server expired unlimited command to set the IP address lease of the specified VLANIF interface address pool to unlimited. If some hosts such as a portable computer just need to user temporary IP addresses, run the dhcp server expired command to set the IP address lease of the specified VLANIF interface address pool to the required time so that the expired IP addresses can be released and assigned to other clients.
When a DHCP client starts or half of its IP address lease has passed, the DHCP client sends a DHCP Request packet to the DHCP server to renew the lease. If the IP address can still be assigned to the client, the DHCP server informs the client of a renewed IP address lease. If the IP address can no longer be assigned to this client, the DHCP server informs the client that the IP address lease cannot be renewed.
Prerequisites
Run the dhcp enable command to globally enable the DHCP function. Run the dhcp select interface command in the VLANIF interface view to enable the interface IP address pool.
Precautions
Different IP address leases can be specified for different interface IP address pools on a DHCP server. In an interface IP address pool, all IP addresses have the same lease.
# Set the IP address lease of the IP address pool on VLANIF 100 to 2 days 2 hours and 30 minutes.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ip address 10.1.1.1 24 [HUAWEI-Vlanif100] dhcp select interface [HUAWEI-Vlanif100] dhcp server expired day 2 hour 2 minute 30