A local DHCP server functions only if there is a relay agent (gateway) in front of it. Either a GI address is needed to find a subnet or Option 82, which is inserted by the relay, to perform authentication in the local-user-db.
The local DHCP server must be configured to assign addresses in one of the following ways:
Use a local user database authentication (user-db local-user-db-name)
The host is matched against the specified local user database. A successful user lookup should return information about one of the following valid addresses:
fixed IP address
The IP address should not overlap with the address ranges configured in the local DHCP server.
pool name
A free address of any subnet in that pool is offered.
use-gi-address [scope subnet | pool]
The GI address is used to find a matching subnet. When scope subnet is configured, an address is allocated in the same subnet as the GI address only. When scope is pool, an address is allocated from any subnet within a local pool when that pool has been selected based on matching the ‟giaddr” field in the DHCP message with any of the configured subnets in the pool.
use-pool-from-client
The pool name specified in the DHCP client message options and added by the DHCP relay agent is used. A free address of any subnet in that pool is offered.
When no valid address information is returned from the local user database lookup, no IP address is offered to the client.
Without local user database authentication (no user-db).
One or both address assignment options must be configured:
Use a pool name (use-pool-from-client)
The pool name specified in the DHCP client message options and added by the DHCP relay agent is used. A free address of any subnet in that pool is offered.
Use the gi address (use-gi-address [scope subnet | pool])
The gi address is used to find a matching subnet. When the scope is subnet, an address is allocated in the same subnet as the gi address only. When scope is pool, an address is allocated from any subnet within a local pool when that pool has been selected based on matching the ‟giaddr” field in the DHCP message with any of the configured subnets in the pool.
When both options are configured and a pool name is specified in the DHCP client message options, then the use-pool-from-client option has precedence over the use-gi-address option.
Options and identification strings can be defined on several levels. In principle, these options are copied into the DHCP reply, but if the same option is defined several times, the following precedence is taken:
user-db host options
subnet options
pool options
from the client DHCP request
A local DHCP server must be bound to a specified interface by referencing the server from that interface. The DHCP server is then addressable by the IP address of that interface. A normal interface or a loopback interface can be used.
A DHCP client is defined by the MAC address and the circuit ID. This implies that for a specified combination of MAC and circuit ID, only one IP address can be returned. The same address is returned if a re-request is made.
Typically, the DHCP server can be configured to perform as follows:
When a user-db is specified, a host lookup is performed in the local-user-db and the local user-db host defines how to get the IP address or pool to get the IP address from:
a fixed IP address
a pool
free address of any subnet in that pool is offered
use-pool-from-client
The pool name is taken from Option 82 vendor-specific sub-option. (If not present, proceed to the next bullet.)
use-gi-address
The gi-address is used to find a matching subnet.
If no IP address, subnet, or pool is found (see the points above), no IP address is offered to the client. If a subnet is found, an available address from the subnet is offered to the client. If a pool is found, an available address from any subnet of the pool is offered to the client.