Overview

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:

  1. 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.

  2. 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.

Note: The local DHCP server does not allocate any address if none of the above options are configured (no user-db, no use-gi-address, no use-pool-from-client).

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:

  1. user-db host options

  2. subnet options

  3. pool options

  4. 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:

Note: The local DHCP server does not allocate any address if none of the above options are configured (no user-db, no use-gi-address, no use-pool-from-client).