Kea dhcp - vendor specific options

Started by A_Hen, April 19, 2024, 11:13:44 PM

Previous topic - Next topic
Missing the ability to add vendor specific DHCP options i KEA DHCP.

The attached picture shows the ability to add vendor specific options i ISC DHCP, but not in Kea DHCP.

In my case I want to add OPTION 43 to announce my UNIFI Controller to the Unifi products I have in my network.

It would be really nice to have the possibility to add DHCP options.

KEA DHCP has the ability to use DHCP options, but then you will have to add them in the configuration file.

If there is a way of doing this, adding the DHCP option to a config file please let me know how, so I can do it that way before it´s possible in the GUI.

I was looking for this also.  Personally I'm waiting (hoping?) for it to be added, as the Kea integration seems pretty raw currently.  (Also doesn't seem to integrate reservation hostnames with DNS forward/reverse lookup?)

Anyway, if you're more ambitious there was info here for options in Kea:

https://kea.readthedocs.io/en/kea-2.2.0/arm/dhcp4-srv.html#custom-dhcpv4-options

And the config files in Opnsense seem to be in /usr/local/etc/kea , although I'm not sure if edits would persist through changes via the UI.

Thanks!

I did look into /usr/local/etc/kea/kea-dhcp4.conf the problem is that it does not survive a reload and any changes from the UI.

I have two options right now. Change to ISC DHCP or wait for the ability to add options via GUI to KEA DHCP.

Changing to ISC DHCP will be a real pain in the a.... as I have quite a lot of static leases and I can´t find any good way to export from KEA DHCP and import into ISC DHCP other than just open two GUI sessions and start copy/past between.

As you say KEA DHCP integration seems to be raw in OPNsense 24.1 (24.1.6).

We can only hope that this will be solved really soon.

Quote from: A_Hen on April 20, 2024, 10:39:38 AM
Changing to ISC DHCP will be a real pain in the a.... as I have quite a lot of static leases and I can´t find any good way to export from KEA DHCP and import into ISC DHCP other than just open two GUI sessions and start copy/past between.
You could export/backup the configuration, create XML for ISC, then import/restore.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: Moonshine on April 20, 2024, 12:27:39 AM
I was looking for this also.  Personally I'm waiting (hoping?) for it to be added, as the Kea integration seems pretty raw currently.  (Also doesn't seem to integrate reservation hostnames with DNS forward/reverse lookup?)

Anyway, if you're more ambitious there was info here for options in Kea:

https://kea.readthedocs.io/en/kea-2.2.0/arm/dhcp4-srv.html#custom-dhcpv4-options

And the config files in Opnsense seem to be in /usr/local/etc/kea , although I'm not sure if edits would persist through changes via the UI.

I'm holding out for DNS etc options for static leases as well. May migrate some subnets that don't utilise for now though.
Already replicated what I had in ISC via config export/import

Hi!

Do we have any update on this topic?

Not the option that anyone wants, but how about a small PC running something like Zentyal Community Edition to handle the DHCP and DNS? An n5105 processor will handle these needs easily. A Mele Quieter 2Q will handle this, I have one running at home in a lab, and it only has a J4125. The 2Q, 3Q, and maybe 4C would be fine for this. Yes, another device.

Thanks, but..........

I don´t want to add another device to my network, just be able to use what´s already there.

And KEA DHCP has the functionality but OPNsense does not support it. I would be nice if KEA could support it the same way as ISC DHCP.
Maybe I have to revert to ISC DHCP.

Update

I finally did solve the problem in my network without the DHCP OPTION i KEA. The DHCP OPTION is not needed when the controller is located on the local network. It's only needed if you have a controller outside of your local network.
I write this, to hopefully  be able to help other in the same situation.
As of now I am using OPNsense v.24.7.7. 

To be able to get all unifi devices to find the controller and the adoption of new devices to work I needed to define the hostname unifi in the local DNS-server (unbound for me) and in the DHCP-scope define my local domain name, so that the unifi devices were able to find the controller.
It turned out that a unifi device when it starts up it tries to find the host unifi by asking the local DNS-server. The problem is that the devices does not know the domain name. It will try to find the host with a not fully qualified domain name. That means that it will try to find just unifi and not unifi.{localdomain}.

After adding the domain name to Domain Search in the DHCP Options the unifi devices was able to find my controller and the adoption of new devices were successful.

Quote from: A_Hen on October 23, 2024, 09:58:23 PMUpdate

I finally did solve the problem in my network without the DHCP OPTION i KEA. The DHCP OPTION is not needed when the controller is located on the local network. It's only needed if you have a controller outside of your local network.
I write this, to hopefully  be able to help other in the same situation.
As of now I am using OPNsense v.24.7.7. 

To be able to get all unifi devices to find the controller and the adoption of new devices to work I needed to define the hostname unifi in the local DNS-server (unbound for me) and in the DHCP-scope define my local domain name, so that the unifi devices were able to find the controller.
It turned out that a unifi device when it starts up it tries to find the host unifi by asking the local DNS-server. The problem is that the devices does not know the domain name. It will try to find the host with a not fully qualified domain name. That means that it will try to find just unifi and not unifi.{localdomain}.

After adding the domain name to Domain Search in the DHCP Options the unifi devices was able to find my controller and the adoption of new devices were successful.

Did you switch to ISC as I can only find a 'domain search' entry field under ISC and I can't find one in KEA or Unbound?