DHCP Configuration

The main IPv4 DHCP configuration mode, entered with dhcp4 server, defines global options for IPv4 DHCP that affect the general behavior of DHCP as well as options that cover all subnets and pools.

To enter IPv4 DHCP configuration mode, enter:

tnsr# configure
tnsr(config)# dhcp4 server
tnsr(config-kea-dhcp4)#

From this mode, there are a variety of possibilities, including:

subnet:

Subnet configuration, see Subnet Configuration.

authoritative (true|false):

Specifies whether this DHCP server is authoritative globally.

When not set as authoritative, clients may not trust leases from this server unless no other servers respond to requests, which may cause significant delays for clients obtaining addresses after switching subnets.

In most cases this will be true, which is the default value.

description:

Description of the DHCP server

option:

A DHCP Option declaration, see DHCP Options.

decline-probation-period <n>:

Decline lease probation period, in seconds.

echo-client-id <boolean>:

Controls whether the DHCP server sends the client-id back to the client in its responses.

expired-leases-processing flush-reclaimed-timer-wait-time <secs>:

Controls the interval, in seconds, at which the DHCP server initiates the lease reclamation procedure.

If expired-leases-processing flush-reclaimed-timer-wait-time and expired-leases-processing hold-reclaimed-time are both non-zero, the DHCP server will consider a lease expired instead of deleting the lease when the client sends a release message.

The default value is 25 seconds.

expired-leases-processing hold-reclaimed-time <secs>:

Controls how long, in seconds, the DHCP server will keep a lease after reclamation. When set to a non-zero value, this enables lease affinity, which allows the DHCP server to reassign the same address to a returning client if it is still available.

If expired-leases-processing flush-reclaimed-timer-wait-time and expired-leases-processing hold-reclaimed-time are both non-zero, the DHCP server will consider a lease expired instead of deleting the lease when the client sends a release message.

The default value is 3600 seconds (one hour).

Tip

To approximate the behavior of other DHCP servers which retain lease affinity data for much longer periods, consider setting this to 2678400 (31 days).

Note

A client may not be able to obtain its former IP address even when lease affinity is active. For example, the DHCP server may be forced to reassign the address if the pool runs out of unallocated addresses.

expired-leases-processing max-reclaim-leases <n>:

Controls the maximum number of reclaimed leases the DHCP server will process at one time.

The default value is 100 leases, a value of 0 is unlimited.

expired-leases-processing max-reclaim-time <msec>:

Limits the maximum amount of time, in milliseconds, the DHCP server can spend performing lease reclamation tasks.

The default value is 250 milliseconds, a value of 0 is unlimited.

expired-leases-processing reclaim-timer-wait-time <secs>:

Limits the amount of time, in seconds, the DHCP daemon waits after completing a reclamation cycle before starting another.

The default value is 10 seconds, allowed range is 0-10000.

expired-leases-processing unwarned-reclaim-cycles <n>:

When the DHCP server lease reclamation process is limited by expired-leases-processing reclaim-timer-wait-time and/or expired-leases-processing max-reclaim-time, the DHCP server may not be able to fully process all leases in a single cycle. This value causes the DHCP server to log a warning if it is unable to complete its reclamation processing within the given number of cycles.

The default value is 5 cycles.

interface listen <if-name>:

The interface upon which the DHCP daemon will listen. This is required.

interface socket (raw|udp):

Controls whether the DHCP daemon uses raw or UDP sockets.

lease filename <path>:

Lease database file

lease lfc-interval <n>:

Lease file cleanup frequency, in seconds.

This value defaults to 3600 which cleans up old lease data at one hour (3600 second) intervals.

Warning

Avoid setting this to a value of 0 which causes lease data to be retained indefinitely. This allows the lease database to continually grow in size over time without limitations.

lease persist <boolean>:

Whether the lease database will persist.

logging <logger-name>:

Controls which events are logged by the DHCP daemon. Enters config-kea-dhcp4-log mode. See DHCP Logging for more information.

match-client-id <boolean>:

When true, DHCP will attempt to match clients first based on client ID and then by MAC address if the client ID doesn’t produce a match. When false, it prefers the MAC address.

next-server <IP Address>:

Specifies a TFTP server to be used by a client.

rebind-timer <n>:

Sets the period, in seconds, at which a client must rebind its address.

renew-timer <n>:

Sets the period, in seconds, at which a client must renew its lease.

valid-lifetime <n>:

The period of time, in seconds, for which a lease will be valid.

Some of these values may be set here globally, and again inside subnets or pools. In each case, the more specific value will be used. For example, if an option is defined in a pool, that would be used in place of a global or subnet definition; A subnet option will be favored over a global option. In this way, the global space may define defaults and then these defaults can be changed if needed for certain areas.