Hi,

That is the intended way.  You can return a null string:

"supersede": "ifelse(member('google-ns'), '8.8.8.8', '')",

and the option will be sent with whatever is the current content
(i.e., remain untouched by "supersede") if the client is not a member
of the 'google-ns' class.

Thank you,
Darren Ankney

On Fri, Mar 7, 2025 at 11:42 AM Walter Reiner via Kea-users
<kea-users@lists.isc.org> wrote:
>
> Hello,
>
> thank you for your help.
>
> I have it now setup in the following way:
>
> ~~~
> "hooks-libraries": [
>   {
>     "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_flex_option.so",
>     "parameters": {
>       "options": [
>         {
>           "name": "domain-name-servers",
>           "supersede": "ifelse(member('google-ns'), '8.8.8.8', 
> '192.168.24.2')",
>           "csv-format": true
>         }
>       ]
>     }
>   }
> ],
> ~~~
>
> I have not found a way to access parameters from a class, but have to put the 
> values directly into the supersede expression.
>
> Just to make sure, is this the intended way to do this or is there a better 
> way I'm not seeing?
>
> Thank you!
>
> > Von: "Darren Ankney" <darren.ank...@gmail.com>
> > An: "Kea user's list" <kea-users@lists.isc.org>
> > Betreff: Re: [Kea-users] Overwrite option-data fields with client-classes in
> > reservations
> > Hello,
> >
> > This is due to precedence which is documented here:
> > https://kea.readthedocs.io/en/kea-2.6.1/arm/dhcp4-srv.html#standard-dhcpv4-options
> >
> > where it says: "The current Kea options precedence order is (from most
> > important to least): host reservation, pool, subnet, shared network,
> > class, global."
> >
> > Kea will use the first option content that it finds for a particular
> > option in that above order. Note that subnet comes before class.
> >
> > You can use the flex_option to override option content based on class
> > membership:
> > https://kea.readthedocs.io/en/kea-2.6.1/arm/hooks.html#libdhcp-flex-option-so-flexible-option-actions-for-option-value-settings
> >
> > Thank you,
> > Darren Ankney
>
>
> --
> 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@lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users
-- 
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@lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users

Reply via email to