Skip to main content

Kea DHCP Configuration Documentation

Overview

This configuration file is set up to provide DHCP services on a 10.10.1.0/24 network, specifically for an internal ISP user services network. It includes specific IP reservations, DNS settings, and comprehensive logging configurations to track DHCP activity at a detailed level.

Configuration Details

{
  "Dhcp4": {
    "interfaces-config": {
      "interfaces": [ "ens18" ]
    },
    "match-client-id": false,
    "subnet4": [
      {
        "subnet": "10.10.1.0/24",
        "pools": [],
        "option-data": [
          {
            "name": "domain-name-servers",
            "data": "10.10.1.10"
          },
          {
            "name": "domain-name",
            "data": "isp1.net"
          }
        ],
        "reservations": [
          {
            "hw-address": "BC:24:11:07:88:16",
            "ip-address": "10.10.1.100"
          }
        ]
      }
    ],
    "loggers": [
      {
        "name": "kea-dhcp4",
        "severity": "DEBUG",
        "output_options": [
          {
            "output": "/var/log/kea/dhcp4.log",
            "maxver": 10
          }
        ]
      },
      {
        "name": "kea-dhcp4.dhcpsrv",
        "severity": "DEBUG",
        "output_options": [
          {
            "output": "/var/log/kea/dhcp4-dhcpsrv.log",
            "maxver": 10
          }
        ]
      },
      {
        "name": "kea-dhcp4.leases",
        "severity": "DEBUG",
        "output_options": [
          {
            "output": "/var/log/kea/dhcp4-leases.log",
            "maxver": 10
          }
        ]
      }
    ]
  }
}

Explanation of Each Section

  1. "interfaces-config":

    • Purpose: Defines the network interfaces Kea should listen on for DHCP requests.
    • Setting: "interfaces": ["ens18"] binds Kea to ens18, the network interface for the 10.10.1.0/24 subnet.
  2. "match-client-id": false:

    • Purpose: Instructs Kea to ignore the DHCP Client ID and rely on the hardware (MAC) address for client identification. This can be helpful if clients do not consistently provide a Client ID or if MAC-based reservations are used.
  3. "subnet4":

    • Purpose: Defines the subnet settings for the 10.10.1.0/24 network.
    • Details:
      • "subnet": "10.10.1.0/24" specifies the address range.
      • "pools": [] indicates no dynamic IP pool is configured, meaning only reservations will be assigned.
      • "option-data" includes DHCP options:
        • "domain-name-servers": "10.10.1.10" specifies the DNS server.
        • "domain-name": "isp1.net" sets the DNS search domain for the network.
      • "reservations" contains static IP reservations:
        • Example Reservation: A device with MAC BC:24:11:07:88:16 receives the reserved IP address 10.10.1.100.
  4. "loggers":

    • Purpose: Enables detailed logging at the DEBUG level, splitting logs across different categories.
    • Details:
      • "kea-dhcp4": General DHCP activity log file at /var/log/kea/dhcp4.log.
      • "kea-dhcp4.dhcpsrv": DHCP server-specific events logged at /var/log/kea/dhcp4-dhcpsrv.log.
      • "kea-dhcp4.leases": Lease assignment and release events logged at /var/log/kea/dhcp4-leases.log.
    • Log Rotation: Each log file has maxver: 10, allowing up to 10 rotated log files.

Usage Notes

  • Reservations: This configuration only serves devices with reservations due to the empty pool configuration. Ensure all required devices have reservations.
  • Logging: The DEBUG level will produce detailed logs useful for troubleshooting and monitoring DHCP activity.

This setup should provide reliable, reservation-based IP assignment with comprehensive logging for monitoring DHCP activity on the 10.10.1.0/24 network. Let me know if there are additional features or details you'd like to incorporate!