[Kea-users] vendor specific dhcp4 options from database

Richard Kojedzinszky richard at kojedz.in
Sat Apr 1 14:22:31 UTC 2023


Dear Darren,

I was reading the docs more a bit. And I understand that Kea supports 
database edits through its hooks, for example hooks_cmd.

I assume upon creating a host reservation, that command will do the 
option encapsulation itself, and as it will store the encapsulated 
values in database. That would be an answer. Howewer, I without a paid 
subscription, and with the need of simplicity, I expect that stored 
options should be encapsulated upon reading from the database.

And, that can be solved by a piece of code I wrote earlier.

That way, there is no need for postgres configuration backend, just the 
hosts database is enough.

Regards,
Richard

2023-04-01 15:56 időpontban Darren Ankney ezt írta:
> Hi Richard,
> 
> You can certainly try to edit the data in the database yourself.  You
> still need to tell Kea how to retrieve it though.
> 
> Perhaps I misunderstood here, but if you are not storing these options
> inside of host reservations, then you will need the configuration
> backend: 
> https://kea.readthedocs.io/en/kea-2.2.0/arm/dhcp4-srv.html#configuration-backend-in-dhcpv4
> to load the options.
> 
> There are three ways to use the database in Kea: Leases (where lease
> assignments by Kea are stored), hosts (where you can store host
> reservations and associated data), and most of the configuration
> (where part or most of the configuration is stored in the database).
> You don't currently (or at least in the configs sent in your first
> message) have a part of your configuration loading things that you've
> setup in the configuration backend.  This doesn't apply if you're
> storing the option data as part of a host reservation.  Then the
> hosts-database directive you have is enough.  I couldn't easily tell
> what you were doing for sure from the mysql dump you sent and I don't
> easily have the ability, at the moment, to restore it to have a look..
> 
> Thank you,
> 
> Darren Ankney
> 
> On Sat, Apr 1, 2023 at 7:41 AM Richard Kojedzinszky <richard at kojedz.in> 
> wrote:
>> 
>> Dear Darren,
>> 
>> Thanks for your reply. I could not find any clues in documentation 
>> that
>> my setup should not work. In
>> https://kea.readthedocs.io/en/kea-2.2.0/arm/config.html#cb-limitations
>> there is paragraph beginning with this statement:
>> 
>> Although it is not recommended, it is possible to specify certain
>> parameter types both in a configuration file and the database.
>> 
>> I expected that I can specify option definitions in configuration 
>> file,
>> which is static, and I just wanted to place dynamic data in database,
>> e.g. option-data parameters.
>> 
>> Thanks,
>> Richard
>> 
>> 2023-03-31 23:02 időpontban Darren Ankney ezt írta:
>> > Hi Richard,
>> >
>> > You would need to load the cb_cmds hook to manage the option-def and
>> > option-data in the database
>> > (https://kea.readthedocs.io/en/kea-2.2.0/arm/hooks.html#cb-cmds-configuration-backend-commands)
>> > using the API commands.  You also need to connect to the database for
>> > configuration backend
>> > (https://kea.readthedocs.io/en/kea-2.2.0/arm/dhcp4-srv.html#configuration-backend-in-dhcpv4)
>> > so that it can load the configuration containing the options from the
>> > database for use.
>> >
>> > I saw neither of these things in your config file.
>> >
>> > Thank you,
>> >
>> > Darren Ankney
>> >
>> > On Fri, Mar 31, 2023 at 2:33 PM Richard Kojedzinszky via Kea-users
>> > <kea-users at lists.isc.org> wrote:
>> >>
>> >> Dear users,
>> >>
>> >> I would like to define vendor specific options in database, howewer I
>> >> dont succeed. If I define it in the config file, it works. I am
>> >> attaching
>> >> kea-dhcp4.static.conf for static and working configuration, and
>> >> attaching kea-dhcp4.dyn.conf and database.dump.sql with relevant
>> >> records
>> >> only. Non-vendor options appear well in the reply packets, howewer
>> >> options in space ipxe dont.
>> >>
>> >> Can somebody help me what am I doing wrong?
>> >>
>> >> Thanks in advance,
>> >> Richard--
>> >> ISC funds the development of this software with paid support
>> >> subscriptions. Contact us at https://www.isc.org/contact/ for more
>> >> information.
>> >>
>> >> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
>> >>
>> >> Kea-users mailing list
>> >> Kea-users at lists.isc.org
>> >> https://lists.isc.org/mailman/listinfo/kea-users


More information about the Kea-users mailing list