<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">“subclass” in ISC DHCP was a “speed hack” according to the manual pages.<div><br></div><div>Basically, you are going to want to create a class called “<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">denyClients</span>” adding the macs that you want to deny to the class (https://kea.readthedocs.io/en/kea-2.2.0/arm/classify.html) possibly something like the below:</div><div><br></div><div><div>“client-classes”: [</div><div>  {</div><div>    “name”: “denyClients”,</div><div>    “test”: “hex string(pkt4.mac, ‘:’) == '11:22:33:44:ab:66’  or <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">hex string(pkt4.mac, ‘:’) == '</span>11:22:33:43:ab:66’ or <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">hex string(pkt4.mac, ‘:’) == '</span>11:22:33:42:ab:66’ ”</div><div>  },</div><div><br></div><div>Tho the test line may not be quite right as I’ve not tested the <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">hex string(pkt4.mac, ‘:’) to make sure that works like I think it does (</span>https://kea.readthedocs.io/en/kea-2.2.0/arm/classify.html#hexstring<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">).</span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Then (there might be a better way to do </span><font color="#000000"><span style="caret-color: rgb(0, 0, 0);">this) define a class that tests membership based on the client not being a member of denyClients</span></font></div><div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);"><br></span></font></div><div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);">  {</span></font></div><div><font color="#000000">    “name”: “allowClients”,</font></div><div><font color="#000000">    “test”: </font><font color="#000000" face="Menlo"><span style="font-size: 11px;">"(not(member(</span><span style="caret-color: rgb(0, 0, 0); font-size: 11px;">‘</span><span style="font-size: 11px;">denyClients')))</span><span style="caret-color: rgb(0, 0, 0); font-size: 11px;">”</span></font></div><div><font color="#000000" face="Menlo"><span style="font-size: 11px;"> }</span></font></div><div><font color="#000000" face="Menlo"><span style="font-size: 11px;">]</span></font></div><div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);"><br></span></font></div><div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);">Then in the subnet add a require class in your pools statement:</span></font></div><div><span style="font-size: 11px; font-family: Menlo; color: rgb(0, 0, 0);">"pools": [</span></div><div><span style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;">  {</span></div><div><font color="#000000" face="Menlo"><span style="font-size: 11px;">    "pool": </span><span style="caret-color: rgb(0, 0, 0); font-size: 11px;">“</span><span style="font-size: 11px;">1.2.3.0-1.2.3.254",</span></font></div><div><div><p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);"><span style="font-variant-ligatures: no-common-ligatures;">    "client-class": "</span>allowClients"</p></div></div><div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);"><br><br></span></font></div><div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);"><br></span></font></div><div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);"><br></span></font></div><div><br><blockquote type="cite"><div>On Dec 14, 2022, at 9:30 AM, Kraishak Mahtha <kraishak.edu@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr">Hi All, <div><br></div><div>I am looking for the equivalent option of ISC dhcp subclass in kea-dhcp4 but I couldn't find any, I have a case where I need to decline dhcp-lease grants to given specific mac addresses so trying to match the same in kea-version but I  couldn't find any sub-class equivalent, can we add the specific data (here mac address as the members of the specific class) in kea<br><br>MY ISC DHCP config<br>class "denyClients" {<br>         match substring (hardware, 1, 6);<br>         deny booting;<br>}<br>subclass "denyClients" 11:22:33:44:ab:66;<br>subclass "denyClients" 11:22:33:43:ab:66;<br>subclass "denyClients" 11:22:33:42:ab:66;<br>subnet 12.0.0.0 netmask 255.255.255.0 {<br>pool {<br>           failover peer "Test";<br>               range 12.0.0.2 12.0.0.2;<br>              deny members of "denyClients";<br>}<br>           default-lease-time 3600;<br> option routers 12.0.0.1;<br> option subnet-mask 255.255.255.0;<br>}<br></div><div><br></div><div><br></div><div>Can anyone please advise or suggest how to add members to the DHCP class or the data for which the class should be applied</div><div><br></div><div>Thanks in Advance</div><div>Kraishak</div><div><br></div><div><br></div><div><br></div></div>
-- <br>ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.<br><br>To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.<br><br>Kea-users mailing list<br>Kea-users@lists.isc.org<br>https://lists.isc.org/mailman/listinfo/kea-users<br></div></blockquote></div><br></div></body></html>