Project

General

Profile

Actions

Bug #15735

closed

Kea fails to give out leases after changing DHCP scope

Added by Andrew Almond 3 months ago. Updated 3 months ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
DHCP (IPv4)
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Default
Affected Version:
Affected Architecture:

Description

Netgate 4100 running 24.03
Kea DHCP on LAN interface with subnet 192.168.1.0/24
DHCP range was reduced from 192.168.1.20-.199 to 192.168.1.20-.150

After making the change, DHCP broke and clients could not longer get IP addresses.

The DHCP log was full of warning messages like these:

WARN [kea-dhcp4.alloc-engine.0x183eaee16d00] ALLOC_ENGINE_V4_ALLOC_FAIL_SUBNET [hwtype=1 xx:ce:c8:cf:d4:xx], cid=[xx:a0:ce:c8:cf:d4:xx], tid=0x2e069ea9: failed to allocate an IPv4 lease in the subnet 192.168.1.0/24, subnet-id 1, shared network (none)

WARN [kea-dhcp4.alloc-engine.0x183eaee16d00] ALLOC_ENGINE_V4_ALLOC_FAIL [hwtype=1 xx:ce:c8:cf:d4:xx], cid=[xx:a0:ce:c8:cf:d4:xx], tid=0x2e069ea9: failed to allocate an IPv4 address after 180 attempt(s)

WARN [kea-dhcp4.alloc-engine.0x183eaee16d00] ALLOC_ENGINE_V4_ALLOC_FAIL_CLASSES [hwtype=1 xx:ce:c8:cf:d4:xx], cid=[xx:a0:ce:c8:cf:d4:x], tid=0x2e069ea9: Failed to allocate an IPv4 address for client with classes: ALL, VENDOR_CLASS_MSFT 5.0, pool_lan_0, UNKNOWN

When looking up the error messages, I came across https://redmine.pfsense.org/issues/15328

We cleared the DHCP Lease table and restarted Kea, which fixed the issue for most clients but a few were still unable to get an IP.
We switched back to ISC and all clients were able to get an IP.

In 15328, the issue seems to be with having multiple IP pools configured.
In this case, we only had the 1 pool configured.

There's a few forum postings about similar issues, such as https://forum.netgate.com/topic/187211/kea-dhcp-does-not-give-new-ip-addresses.

I'm not sure if the updated Kea version that's coming with 24.08 will also fix this issue or if this is something separate.

This is the kea-dhcp4.conf file we're using:

{
    "Dhcp4": {
        "interfaces-config": {
            "interfaces": [
                "igc0" 
            ]
        },
        "lease-database": {
            "type": "memfile",
            "persist": true,
            "name": "/var/lib/kea/dhcp4.leases" 
        },
        "loggers": [
            {
                "name": "kea-dhcp4",
                "output_options": [
                    {
                        "output": "syslog" 
                    }
                ],
                "severity": "INFO" 
            }
        ],
        "valid-lifetime": 7200,
        "max-valid-lifetime": 86400,
        "ip-reservations-unique": false,
        "echo-client-id": false,
        "option-data": [
            {
                "name": "domain-name",
                "data": "company.local" 
            }
        ],
        "option-def": [
            {
                "space": "dhcp4",
                "name": "ldap-server",
                "code": 95,
                "type": "string" 
            }
        ],
        "hooks-libraries": [
            {
                "library": "/usr/local/lib/kea/hooks/libdhcp_lease_cmds.so" 
            }
        ],
        "control-socket": {
            "socket-type": "unix",
            "socket-name": "/tmp/kea4-ctrl-socket" 
        },
        "authoritative": true,
        "client-classes": [
            {
                "name": "pool_lan_0",
                "test": "member('ALL')" 
            }
        ],
        "subnet4": [
            {
                "id": 1,
                "subnet": "192.168.1.0/24",
                "option-data": [
                    {
                        "name": "domain-name-servers",
                        "data": "192.168.1.1" 
                    },
                    {
                        "name": "routers",
                        "data": "192.168.1.1" 
                    }
                ],
                "pools": [
                    {
                        "pool": "192.168.1.20 - 192.168.1.150",
                        "client-class": "pool_lan_0" 
                    }
                ],
                "reservations-in-subnet": true
            }
        ]
    }
}

Here's a portion of the dhcpd.log. I also have full logs and some packet captures available if Netgate staff would like to see them.

9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.bad-packets.0x7b49e816600] DHCP4_PACKET_NAK_0003 [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: failed to advertise a lease, client sent ciaddr 0.0.0.0, requested-ip-address (no address)
9/19/2024 12:44    kea-dhcp4    14239    WARN [kea-dhcp4.alloc-engine.0x7b49e816600] ALLOC_ENGINE_V4_ALLOC_FAIL_CLASSES [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: Failed to allocate an IPv4 address for client with classes: ALL, VENDOR_CLASS_MSFT 5.0, pool_lan_0, UNKNOWN
9/19/2024 12:44    kea-dhcp4    14239    WARN [kea-dhcp4.alloc-engine.0x7b49e816600] ALLOC_ENGINE_V4_ALLOC_FAIL [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: failed to allocate an IPv4 address after 131 attempt(s)
9/19/2024 12:44    kea-dhcp4    14239    WARN [kea-dhcp4.alloc-engine.0x7b49e816600] ALLOC_ENGINE_V4_ALLOC_FAIL_SUBNET [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: failed to allocate an IPv4 lease in the subnet 192.168.1.0/24, subnet-id 1, shared network (none)
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.alloc-engine.0x7b49e816600] ALLOC_ENGINE_V4_OFFER_NEW_LEASE allocation engine will try to offer new lease to the client [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.dhcpsrv.0x7b49e816600] DHCPSRV_MEMFILE_GET_HWADDR obtaining IPv4 leases for hardware address hwtype=1 a0:ce:c8:cf:d4:92
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.ddns.0x7b49e816600] DHCP4_RESPONSE_HOSTNAME_DATA [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: including Hostname option in the server's response: laptop-5hdm6td
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.ddns.0x7b49e816600] DHCP4_CLIENT_HOSTNAME_DATA [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: client sent Hostname option: laptop-5hdm6td
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.ddns.0x7b49e816600] DHCP4_CLIENT_HOSTNAME_DATA [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: client sent Hostname option: laptop-5hdm6td
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.ddns.0x7b49e816600] DHCP4_CLIENT_HOSTNAME_PROCESS [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: processing client's Hostname option
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.dhcp4.0x7b49e816600] DHCP4_CLASS_ASSIGNED [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: client packet has been assigned to the following class(es): ALL, VENDOR_CLASS_MSFT 5.0, pool_lan_0, UNKNOWN
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.dhcp4.0x7b49e816600] DHCP4_CLASS_ASSIGNED [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: client packet has been assigned to the following class(es): UNKNOWN
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.packets.0x7b49e816600] DHCP4_SUBNET_DATA [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: the selected subnet details: 192.168.1.0/24
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.packets.0x7b49e816600] DHCP4_SUBNET_SELECTED [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: the subnet with ID 1 was selected for client assignments
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.packets.0x7b49e816600] DHCP4_QUERY_DATA [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768, packet details: local_address=255.255.255.255:67, remote_address=0.0.0.0:68, msg_type=DHCPDISCOVER (1), transid=0x11e08768, options: type=012, len=015: "laptop-5hdm6td" (string) type=053, len=001: 1 (uint8) type=055, len=014: 1(uint8) 3(uint8) 6(uint8) 15(uint8) 31(uint8) 33(uint8) 43(uint8) 44(uint8) 46(uint8) 47(uint8) 119(uint8) 121(uint8) 249(uint8) 252(uint8) type=060, len=008: "MSFT 5.0" (string) type=061, len=007: 01:a0:ce:c8:cf:d4:92
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.packets.0x7b49e816600] DHCP4_PACKET_RECEIVED [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface igc0
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.packets.0x7b49e816600] DHCP4_SUBNET_DATA [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: the selected subnet details: 192.168.1.0/24
9/19/2024 12:44    kea-dhcp4    14239    DEBUG [kea-dhcp4.packets.0x7b49e816600] DHCP4_SUBNET_SELECTED [hwtype=1 a0:ce:c8:cf:d4:92], cid=[01:a0:ce:c8:cf:d4:92], tid=0x11e08768: the subnet with ID 1 was selected for client assignments

Related issues

Is duplicate of Bug #15328: Changes in Kea DHCP interface pools may invalidate lease database contentResolvedChristian McDonald

Actions
Actions #1

Updated by Jim Pingle 3 months ago

  • Project changed from pfSense Plus to pfSense
  • Category changed from DHCP Server (IPv4) to DHCP (IPv4)
  • Status changed from New to Duplicate
  • Affected Plus Version deleted (24.03)

Duplicate of #15328 which is already fixed in 24.08

Actions #2

Updated by Jim Pingle 3 months ago

  • Is duplicate of Bug #15328: Changes in Kea DHCP interface pools may invalidate lease database content added
Actions #3

Updated by Jim Pingle 3 months ago

It's still almost certainly a duplicate, unless you can reproduce it on 24.08 snapshots.

Actions

Also available in: Atom PDF