Hi Veronique,

    "client-classes" within a reservation definition can only contain a list of 
classes:


Can you explain what you are trying to achieve here? There may be another way 
of accomplishing it.


Kind Regards Peter

>From "Kea Configuration File Syntax (BNF)":

reservation_client_classes ::= "client-classes" ":" list_strings

list_strings ::= "[" list_strings_content "]"


Sent from Outlook<http://aka.ms/weboutlook>
________________________________
From: Kea-users <[email protected]> on behalf of Veronique 
Lefebure <[email protected]>
Sent: 20 July 2021 15:45
To: [email protected] <[email protected]>
Subject: [Kea-users] Example for ifelse in host reservation or class


Hi,

Is there a way to use ifelse in a host reservation ?

We would like something like

"reservations": [ { "hw-address": "xx:xx:xx:xx:xx:fa", "ip-address": 
"yy.yy.yy.121", "hostname": "lab-client", "client-classes": [ " ifelse ( 
substring(option[vendor-class-identifier].text, 0, 9) == 'PXEClient' , 
'Desktop', none) " ] },

But the above does not work: KEA interprets the whole string "ifelse ( 
substring(option[vendor-class-identifier].text, 0, 9) == 'PXEClient' , 
'Desktop', none) " as being the client-class name itself.

Alternatively we could use "ifelse" in the client-class definition but none of 
the combinations we have tried works: we always get a syntax error reported by 
the validation of the json configuration file.

What we need is the equivalent of what we have in DHCPD:

group { # Desktop Clients if substring (option vendor-class-identifier, 0, 9) = 
"PXEClient" { option vendor-class-identifier "PXEClient"; option 
dhcp-server-identifier aims.xxx; next-server aims.xxx; } host client1 { 
hardware ethernet xx:xx:xx:xx:xx:fa; option host-name "lab-client"; 
fixed-address yy.yy.yy.121; } ....

}

Thanks,

Veronique
_______________________________________________
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
[email protected]
https://lists.isc.org/mailman/listinfo/kea-users

Reply via email to