Friday, October 18, 2024
HomeTechFinally I upgraded from isc-dhcp-server to isc-kea for my home lab

Finally I upgraded from isc-dhcp-server to isc-kea for my home lab

Date:

Related stories

Broken down this way, the migration process doesn’t seem so intimidating — and it’s made easier by the fact that Kea’s default configuration files come packed with descriptive comments and configuration examples that you can take advantage of. (And again, ISC did a job distinct Function with Kea documents. All versions, from neglected to advanced, have it Comprehensive and extensive online documentation If you’re interested in knowing what a particular option does or where to apply it – and as mentioned above, there are also sample configuration files available to break down if you want more detailed examples.)

Configuration time for DHCP

We have two Kea applications to configure, so we’ll do DHCP first and then move on to the DDNS side. (Although the DHCP configuration file also contains a bunch of DDNS stuff, so I guess if we’re being pedantic, we’re setting up both at once.)

The first file to modify, if you installed Kea via a package manager, is /etc/kea/kea-dhcp4.conf. The file should already have some reasonable defaults, and it’s helpful to take a moment to look at the comments and see what those defaults are and what they mean.

Here’s a slightly sanitized version of my work kea-dhcp4.conf file:

{
  "Dhcp4": {
    "control-socket": {
      "socket-type": "unix",
      "socket-name": "/tmp/kea4-ctrl-socket"
    },
    "interfaces-config": {
      "interfaces": ["eth0"],
      "dhcp-socket-type": "raw"
    },
    "dhcp-ddns": {
      "enable-updates": true
    },
    "ddns-conflict-resolution-mode": "no-check-with-dhcid",
    "ddns-override-client-update": true,
    "ddns-override-no-update": true,
    "ddns-qualifying-suffix": "bigdinosaur.lan",
    "authoritative": true,
    "valid-lifetime": 86400,
    "renew-timer": 43200,
    "expired-leases-processing": {
      "reclaim-timer-wait-time": 3600,
      "hold-reclaimed-time": 3600,
      "max-reclaim-leases": 0,
      "max-reclaim-time": 0
    },
    "loggers": [
    {
      "name": "kea-dhcp4",
      "output_options": [
        {
          "output": "syslog",
          "pattern": "%-5p %m\n",
          "maxsize": 1048576,
          "maxver": 8
        }
      ],
      "severity": "INFO",
      "debuglevel": 0
      }
    ],
    "reservations-global": false,
    "reservations-in-subnet": true,
    "reservations-out-of-pool": true,
    "host-reservation-identifiers": [
      "hw-address"
    ],
    "subnet4": [
      {
        "id": 1,
        "subnet": "10.10.10.0/24",
        "pools": [
          {
            "pool": "10.10.10.170 - 10.10.10.254"
          }
        ],
        "option-data": [
          {
            "name": "subnet-mask",
            "data": "255.255.255.0"
          },
          {
            "name": "routers",
            "data": "10.10.10.1"
          },
          {
            "name": "broadcast-address",
            "data": "10.10.10.255"
          },
          {
            "name": "domain-name-servers",
            "data": "10.10.10.53"
          },
          {
            "name": "domain-name",
            "data": "bigdinosaur.lan"
          }
        ],
        "reservations": [
          {
            "hostname": "host1.bigdinosaur.lan",
            "hw-address": "aa:bb:cc:dd:ee:ff",
            "ip-address": "10.10.10.100"
          },
          {
            "hostname": "host2.bigdinosaur.lan",
            "hw-address": "ff:ee:dd:cc:bb:aa",
            "ip-address": "10.10.10.101"
          }
        ]
      }
    ]
  }
}

The first segments set up the control socket on which the DHCP process listens for management API commands (we won’t set up the management tool, which is overkill for a homelab, but this will ensure the socket is there if you decide to go in that direction). They also set up the interface on which Kea listens for DHCP requests, and have Kea listen to those requests in raw socket mode. You sure want that raw As your DHCP socket type (Look here why), but this can also be set to udp If necessary.

See also  iOS 15.4 from Apple: The biggest updates coming to your iPhone next week

Latest stories