OPNsense Forum

Archive => 24.1, 24.4 Legacy Series => Topic started by: Alpha_DE on June 22, 2024, 03:07:19 PM

Title: KEA DHCP crashing
Post by: Alpha_DE on June 22, 2024, 03:07:19 PM
Hey!

I recently switched a pfSense to OPNsense and after having done so, I added some VLAN to encapsulate IoT and Amazon Devices. Now I am moving devices from the main network to those new VLAN tagged Wifi networks.

Adding another entry (previously assigned an address with DHCP), KEA crashed with

2024-06-22T14:57:30 Error kea-dhcp4 ERROR [kea-dhcp4.dhcp4.0x8366ae000] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/usr/local/etc/kea/kea-dhcp4.conf': failed to add new host using the HW address 'd8:13:2a:4a:09:2c and DUID '(null)' to the IPv4 subnet id '2' for the address 192.168.28.101: There's already a reservation for this address
2024-06-22T14:57:30 Error kea-dhcp4 ERROR [kea-dhcp4.dhcp4.0x8366ae000] DHCP4_CONFIG_LOAD_FAIL configuration error using file: /usr/local/etc/kea/kea-dhcp4.conf, reason: failed to add new host using the HW address 'd8:13:2a:4a:09:2c and DUID '(null)' to the IPv4 subnet id '2' for the address 192.168.28.101: There's already a reservation for this address
2024-06-22T14:57:30 Error kea-dhcp4 ERROR [kea-dhcp4.dhcp4.0x8366ae000] DHCP4_PARSER_FAIL failed to create or run parser for configuration element subnet4: failed to add new host using the HW address 'd8:13:2a:4a:09:2c and DUID '(null)' to the IPv4 subnet id '2' for the address 192.168.28.101: There's already a reservation for this address


I checked the config and there was no duplicate entry for that mac. I managed to get access to the OPNsense again and deleted the single entry from the config thus got it working again.

Beside that, even if, such an error should result in a warning and skipping of the second (duplicate) entry marking him erronous in the reservations section but must not prevent KEA from starting as a running DHCP can be critical to access the network.
Title: Re: KEA DHCP crashing
Post by: newsense on June 22, 2024, 05:45:26 PM
OK, you deleted an entry, but did you search for the offending MAC in the config file ?

Speaking of the config file, do you edit it by hand or in the GUI ?

KEA can be odd. It will start and run without errors with a reservation for the same MAC in two different VLANS - yet fail to answer the particular device on any VLAN - hence the machine will eventually move to APIPA. It won't crash on startup or anytime after though because of a MAC being present in two VLANs.
Title: Re: KEA DHCP crashing
Post by: Alpha_DE on June 22, 2024, 06:11:50 PM
I only use the GUI, I do not manipulate the config file directly. But still, a DHCP should not crash on that leaving the whole network unusable. It's an error, but not a fatal one.
Title: Re: KEA DHCP crashing
Post by: newsense on June 23, 2024, 11:23:41 AM
You should still check both /conf/config.xml and /usr/local/etc/kea/kea-dhcp4.conf.

As I said, KEA can run just fine with a duplicate reservation in the config. There must be something else there that causes that crash