Kea DHCP Documentation

repository·master·Indexed 20 days ago

https://github.com/isc-projects/kea

Developer and administrative documentation for Kea, including database schema management for MySQL, PostgreSQL, and memfile backends. Covers the use of the kea-admin tool for database initialization and upgrades, backend capability comparisons, and the client classification lifecycle for applying specific DHCP settings and behaviors.

Tokens
269.2K
Snippets
636
Records
907
Agent score
70%

What's inside Kea

  1. Overview of Kea DHCP software components

    master
    Kea is a modular DHCP server solution that uses multiple cooperating processes to provide DHCPv4 and DHCPv6 functionality, including prefix delegation and dynamic DNS updates. The software suite consists of several specialized processes and tools for management, configuration, and testing.
  2. Overview of the Hammer Building Tool

    master

    Hammer is a Python 3 script used to automate Kea build tasks, including setting up virtual machines (LXC or VirtualBox), installing dependencies, compiling Kea with various options, and running unit tests.

    Important Notes:

    • Hammer is an internal tool and is not included in the official Kea distribution (though it is available in the Kea git repository).
    • ISC does not guarantee its operation; use it at your own discretion.
    • All Hammer functionality can be performed manually if preferred.
  3. Overview of the Kea Shell

    master
    The kea-shell is a non-interactive, scripting-friendly command-line client used to interact with Kea servers via their RESTful HTTP control interface. It allows administrators to send commands with JSON parameters to the server and retrieve responses. While designed primarily for use in scripts, it can be used manually by providing command parameters via standard input.
  4. Overview of the kea-lfc process

    master

    The kea-lfc process is a service designed to remove redundant information from files used for persistent storage in the Kea DHCP memfile database backend.

    It is typically run periodically by Kea DHCP servers. Since Kea version 3.1.2, it can be started using the kea-lfc-start command. While it can be started externally, it is primarily intended to be managed by the DHCP server processes. The process uses a specific set of files for input, output, and bookkeeping to ensure data integrity even if the process is interrupted.

  5. Available ISC Hook Libraries

    master

    Kea provides a hook functionality to customize servers without modifying core code. ISC provides several hook libraries that can be loaded into Kea processes. As of Kea 3.0.0, most are open source, while some require paid ISC support contracts.

    Important: When a library does not work as expected, verify that it has been loaded by the correct Kea process (e.g., kea-dhcp4, kea-dhcp6, or kea-dhcp-ddns) as specified in the library's documentation.

  6. Supported DHCP-DDNS Standards and RFCs

    master

    The DHCP-DDNS server supports the following standards:

    • TSIG (RFC 2845): Secret Key Transaction Authentication for DNS. All DNS update packets can be protected by TSIG signatures.
    • DNS UPDATE (RFC 2136): The complete DNS update mechanism is supported.
    • FQDN Conflict Resolution (RFC 4703): Handles conflict resolution for both DHCPv4 and DHCPv6 servers.
    • DHCID RR (RFC 4701): Uses DHCID records for encoding DHCP information.
  7. Use libdhcp_subnet_cmds.so to manage subnets and shared networks

    master

    The libdhcp_subnet_cmds.so library provides a lightweight way to query and manipulate subnet and shared network configurations in Kea without requiring a full server reconfiguration. This is particularly useful for deployments with large numbers of frequently updated subnets.

    Key Constraints:

    • This library can only be loaded by the kea-dhcp4 or kea-dhcp6 processes.
    • It is part of the open source code and available to all Kea users.

    Supported Capabilities:

    • Subnet Management: List, get details, add, update, delete, and perform delta updates (add/remove parts of a subnet) for both IPv4 and IPv6.
    • Shared Network Management: List, get details, add, and remove shared networks, as well as adding/removing subnets from shared networks.
  8. Use the kea-dhcp-ddns service

    master

    The kea-dhcp-ddns service is a standalone process responsible for requesting DNS mapping updates based on DHCP lease-change events. It operates by receiving Name Change Requests from Kea DHCP servers.

    To run the service, you must provide a configuration file using the -c flag. This configuration file contains settings for the DHCP-DDNS server and may also include configuration entries for other Kea services.

    kea-dhcp-ddns -c <config-file>
  9. What is the Kea Configuration Backend (CB)?

    master

    The Kea Configuration Backend (CB) allows Kea servers to store almost all of their configuration in one or more databases (MySQL or PostgreSQL) instead of local JSON files. This enables a "single source of truth" for multiple Kea servers, allowing for identical configuration sections to be reused across sites and providing real-time logic checks via an API.

    Key Benefits:

    • Centralized configuration management.
    • Real-time propagation of updates to all Kea instances.
    • Integration with third-party automation and provisioning tools.
    • Database-driven concurrency, consistency, and atomicity.

    Important Note: Using a database for leases or host reservations is a separate feature and does not require the Configuration Backend. For those, use the host-databases and lease-database configuration directives.

  10. What is Congestion Handling in Kea?

    master

    Congestion occurs when client queries arrive faster than the server can process them, leading to a backlog. Kea mitigates this by using a separate thread to read packets from interface socket buffers into an internal packet queue. The main application thread then processes packets from this queue instead of directly from the socket buffers.

    This architecture allows the server to make decisions on which packets to process, how to store them, and their processing order. The default implementation is a ring buffer that discards the oldest packets when it reaches capacity.

    Note: Congestion handling is incompatible with multi-threading. If both are enabled, congestion handling is silently disabled.

  11. Overview of Client Classification in Kea

    master

    Client Classification allows Kea to differentiate between different types of clients (e.g., a cable modem vs. a device behind a modem, or a smartphone vs. a laptop) and treat them differently. This is useful for applying specific settings or behaviors to groups of clients.

    Common use cases include:

    • Assigning different DHCP options to specific client types.
    • Selecting different subnets or pools based on client class.
    • Implementing lease or rate limiting per class.
    • Tuning DDNS behavior.
    • Dropping queries from specific classes.
    • Setting specific TFTP server addresses or boot files for DHCPv4 cable modems.

    Ways to associate a packet with a class:

    • Implicitly: Using vendor class options or other built-in conditions.
    • Expressions: Using a boolean expression that evaluates to true.
    • Reservations: Using static host reservations, shared networks, or subnets.
    • Hooks: Using a Kea hook library.