<div dir="ltr">Hi Darren, <div><br></div><div>Thanks for the response, </div><div><br></div><div>"client-class": [<br> "allow-one",<br> "HA_dhcp1"<br>]<br></div><div>--> I tried this but it gives me a syntax error <br>Syntax check failed with: kea-dhcp4.conf:90.29: syntax error, unexpected [, expecting constant string<br></div><div><br></div><div>so in my case where subnets have multiple client class combinations, then I need to create multiple client class definitions. I have only 5 class definitions overall when I use ISC DHCP now it may go more than 10+, It is making bit complex when compared to the ISC-DHCP flow</div><div><br></div><div>Kraishak</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 5, 2023 at 8:38 PM Darren Ankney <<a href="mailto:darren.ankney@gmail.com">darren.ankney@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Kraishak,<br>
<br>
I don't think you can have multiple client classes specified at the<br>
pool level. If you could, it would be done something like this:<br>
<br>
"client-class": [<br>
"allow-one",<br>
"HA_dhcp1"<br>
]<br>
<br>
You will probably need to create a class for each that contains the<br>
members you want in that pool as you show in the second example. Its<br>
made easier by the "member" and "not member" syntax.<br>
<br>
Thank you,<br>
<br>
Darren Ankney<br>
<br>
On Fri, May 5, 2023 at 9:25 AM Kraishak Mahtha <<a href="mailto:kraishak.edu@gmail.com" target="_blank">kraishak.edu@gmail.com</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> I have a use case where one of the client class definitions should be applied for all subnets and my configuration has also been in the HA, so basically I need to assign two classes or sometimes I need to add more class statements to a subnet.<br>
> So I tried configuring it like this and it didn't give me any syntax error<br>
> Code snippet 1:<br>
> ===============<br>
> "subnet4": [{<br>
> "subnet": "<a href="http://4.0.0.0/24" rel="noreferrer" target="_blank">4.0.0.0/24</a>",<br>
> "valid-lifetime": 86400,<br>
> "option-data": [<br>
> {<br>
> "data": "<a href="http://test.com" rel="noreferrer" target="_blank">test.com</a>",<br>
> "name": "domain-name"<br>
> },<br>
> {<br>
> "data": "255.255.255.0",<br>
> "name": "subnet-mask"<br>
> },<br>
> {<br>
> "data": "4.0.0.1",<br>
> "name": "routers"<br>
> }<br>
> ],<br>
> "pools": [{<br>
> "client-class": "allow-one,HA_dhcp1",<br>
> "pool": "4.0.0.2-4.0.0.6"<br>
> }],<br>
> "id": 1<br>
> }],<br>
> "client-classes": [<br>
> {"name": "deny-one"},<br>
> {<br>
> "test": "(not(member('deny-one')))",<br>
> "name": "allow-one"<br>
> }<br>
> ]<br>
><br>
> Basically, in the deny class statement, I will be adding my black-listing clients. I am able to start the kea-dhcp service with the above config file and the service is up and running but logically it seems to be wrong and I am facing issues while the lease flow,<br>
> Later when I searched more for multiple class statements then I found like<br>
> Code snippet 2:<br>
> ===============<br>
> "Dhcp4": {<br>
> "client-classes": [{<br>
> "name": "phones",<br>
> "test": "substring(option[60].hex,0,6) == 'Aastra'",<br>
> }, {<br>
> "name": "laptops",<br>
> "test": "not member('phones')"<br>
> }, {<br>
> "name": "phones_server1",<br>
> "test": "member('phones') and member('HA_server1')"<br>
> }, {<br>
> "name": "phones_server2",<br>
> "test": "member('phones') and member('HA_server2')"<br>
> }, {<br>
> "name": "laptops_server1",<br>
> "test": "member('laptops') and member('HA_server1')"<br>
> }, {<br>
> "name": "laptops_server2",<br>
> "test": "member('laptops') and member('HA_server2')"<br>
> }],<br>
> Where we need to create one more class definition combined with the existing class,<br>
><br>
> I want to know if code snippet 2 is the only way of dealing with the multiple client classes, I think code snippet 1 is also another way of dealing with the client classes because it is not giving any syntax error when I start kea-dhcp(Or I could be wrong to...)<br>
><br>
> The problem is I have a use case where I have 5-6 client classes for some subnets and among these I will be using 2,3,4 for one subnet and 1,4,5 for another subnet likewise If I follow the second way of dealing with the multiple client classes the configuration would be much complex.<br>
> In ISC-DHCP we just need one statement for the client class like<br>
> allow members of client1;<br>
> deny member of client2;<br>
> ....some thing like this<br>
><br>
> If anyone has familiarity with these concepts, much appreciate for your guidance or suggestion<br>
><br>
> Thanks in advance<br>
> Kraishak<br>
><br>
><br>
><br>
><br>
> --<br>
> ISC funds the development of this software with paid support subscriptions. Contact us at <a href="https://www.isc.org/contact/" rel="noreferrer" target="_blank">https://www.isc.org/contact/</a> for more information.<br>
><br>
> To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
><br>
> Kea-users mailing list<br>
> <a href="mailto:Kea-users@lists.isc.org" target="_blank">Kea-users@lists.isc.org</a><br>
> <a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/kea-users</a><br>
</blockquote></div>