Leases

When DHCP sends configuration information to a client, the information is sent with a lease time. This is the length of time that the client can use the IP address it has been assigned. The duration of the lease time can be changed according to your specific requirement.

During the lease time, the DHCP server cannot assign that IP address to any other clients. The purpose of a lease is to limit the length of time that a client can use an IP address. A lease prevents unused clients from taking up IP addresses when there are more clients than addresses. It also enables the administrator to make configuration changes to all of the clients on the network in a limited amount of time. When the lease expires, the client will request a new lease from DHCP. If the configuration data has changed, the new data will be sent to the client at that time.

Lease renewal

The client starts to renew a lease when half of the lease time has passed. For example, for a 24-hour lease, the client will attempt to renew the lease after 12 hours. The client requests the renewal by sending a DHCPREQUEST message to the server. The renewal request contains the current IP address and configuration information of the client.

If the server accepts the request, it will send an DHCPACK message back to the client. If the server does not respond to the request, the client can continue to use the IP address and configuration information until the lease expires. If the lease is still active, the client and server do not need to go through the DHCPDISCOVER and DHCPREQUEST process. When the lease has expired, the client must start over with the DHCPDISCOVER process.

If the server is unreachable, the client can continue to use the assigned address until the lease expires. In the previous example, the client has 12 hours from when it first tries to renew the lease until the lease expires. During a 12-hour outage, new users cannot get new leases, but no leases will expire for any computer turned on at the time that the outage starts.

Determining lease duration

The default lease time for the DHCP server is 24 hours. When setting the lease time on your DHCP server, consider your goals, usage patterns of your site, and service arrangements for your DHCP server. Use the following questions to help you decide on an appropriate lease time.

Do you have more users than addresses?
If so, the lease time must be short so that clients do not need to wait for unused leases to expire.
Do you have a minimum amount of time that you need to support?
If your typical user is on for an hour at minimum, that suggests an hour lease at minimum.
How much DHCP message traffic can your network handle?
If you have a large number of clients or slow communication lines over which the DHCP packets will run, network traffic might cause problems. The shorter the lease, the heavier traffic the server and network load from the renewal request on your network.
What kind of service plan do you have in place, and to what extent can your network handle an outage?
Consider any routine maintenance, and the potential impact of an outage. If the lease time is at least twice the server outage time, then running clients who already have leases will not lose them. If you have a good idea of your longest likely server outage, you can avoid such problems.
What type of network environment is the DHCP server in? What does a typical client do?
Consider what the clients do on the network that the DHCP server is servicing. For example, if you have an environment where the clients are primarily mobile, connecting to the network at varying times, and checking their e-mail typically only once or twice a day, you might want a relatively short lease time. In this case, it might not be necessary to have a single IP address set aside for every client. By limiting the lease time, you can use fewer IP addresses to support the mobile clients.
Alternatively, if you have an office environment where most of the employees have primary workstations in a fixed location, a lease time of 24 hours might be more appropriate. It might also be necessary in this environment to have an IP address available for each client that connects to the network during business hours. In this case, if you specify a shorter lease time, the DHCP server negotiates the lease renewal much more frequently with the clients, which causes excess network traffic.
How much does your network configuration change?
If your network topology changes quite frequently, you might want to stay away from longer leases. Long leases can be disadvantageous in cases where you need to change a configuration parameter. The length of the lease can mean the difference between having to go to every affected client and restarting it, or merely waiting a certain amount of time for the leases to be renewed.
If your network topology rarely changes and you have enough IP addresses in your address pool, you can configure DHCP to use infinite leases, that is, leases that never expire. However, infinite leases are not recommended. If you use an infinite lease, the IP address is leased to the client indefinitely. These clients do not need to go through any lease renewal process after they receive the infinite lease. After an infinite lease is assigned to a client, that address cannot be assigned to another client. Therefore, if you want to assign that client a new IP address or lease the client's IP address to another client later, problems might occur.
You might have clients in your network, such as a file server, that will always receive the same IP address. Rather than using an infinite lease, assign a specific address to the client and give it a long lease time. The client still must lease it for a given amount of time and renew the lease, but the DHCP server reserves the IP address for that client only. Then, if you get a new file server, for example, you can just change the client identifier (MAC address) and the DHCP server gives the new file server that same address. If you have given it an infinite lease, then the DHCP server cannot give out the address again unless the lease is explicitly deleted.