DHCP Leases
A lease is defined as the time period for which a DHCP server allocates an IP address to a client. The lease can be extended upon subsequent requests. If the client no longer needs the IP address, it can release the address back to the server before the lease expires. The server is then free to assign this address to a different client if no other idle IP address is available.
The lease period configured for a DHCP server applies to all of the IP addresses that a DHCP server dynamically assigns to its clients. A different DHCP server may have a different lease term for its clients. A statically allocated IP address is not subject to the lease terms.
A DHCP client does not wait for its lease to expire, because it may be assigned a different IP address. Instead, when a DHCP client reaches the halfway point of its lease period, it attempts to extend its lease so that it retains the same IP address.
Address Pools
An address pool is a set of all the IP addresses that a DHCP server has reserved for dynamic client allocation. Along with each IP address, the server stores certain network parameters, such as a default lease length for the IP address and other configuration parameters (for example, a subnet mask and the address of the default gateway) to be sent to the client when it is assigned that IP address.
Address pools are classified into interface address pools and global address pools.
A DHCP server selects address pools according to whether a DHCP relay agent is deployed. When no relay agent is deployed, the server selects the address pool on the same network segment as the IP address of the interface receiving DHCP Request messages. When relay agents are deployed, the server selects the address pool on the same network segment as the IP address specified in the giaddr field of received DHCP Request messages.
The number of IP addresses required in an address pool depends mainly on the number of clients that will connect to the network and the frequency at which they connect and disconnect.
IP addresses in an address pool can be in the following status based on the IP address usage:
Used: indicates that the IP address is in use.
Idle: indicates that the IP address is idle.
Static-bind: indicates that the IP address is bound to a MAC address and is not in use.
Static-bind used: indicates that the IP address is bound to a MAC address and is in use.
Disable: indicates that the IP address cannot be used.
You can run the dhcp server excluded-ip-address (interface address pool) or excluded-ip-address (global address pool) command to exclude IP addresses in Disable status.
Expired: indicates that the IP address expires and is idle.
After an IP address in an address pool expires, it is in Expired status. Allocation records of IP addresses in Expired status are retained, so that when a user requests an IP address again, the previously associated IP address can be directly allocated to the user, ensuring stability of user IP addresses.
When IP addresses in Idle status are exhausted, the address pool automatically reclaims the IP addresses in Expired status and allocates the IP addresses to the users without the need to manually clear the IP addresses.
Conflict: indicates that the IP address conflicts with another IP address on the network.
When an IP address in Conflict status exists in an address pool, an IP address conflict is prevented in advance. An IP address in Conflict status will exist in the following situations:
When IP addresses in Idle and Expired status in an address pool are exhausted, the address pool automatically reclaims the IP addresses in Conflict status. The server then allocates the IP addresses to new users without the need to manually clear the address pool.
When sending DHCP Discover messages to apply for IP addresses, some wireless STAs will respond to ping packets sent from the DHCP server. As a result, IP address conflicts are reported mistakenly. In this case, you can run the dhcp server ping packet 0 command to disable ping detection of the address pool. By default, 2 is specified in the command. If 0 is specified in the command, ping detection is disabled.