Class matching

Bill Shirley Bill at Henagar.PolymerIndustries.biz
Mon Sep 29 20:58:08 UTC 2014


Thanks for your reply.

I would like the flexibility of putting different options in the classes and pulling them all together in the "Printers" 
class. That way there is just one allow members of "Printers"; in each pool.  We have a lot of different RF guns from 
several vendors where this might come in handy.

Yeah, I could repeat the substring(hardware, 1,3)in the "Printers" class but was wanting to know if that could be avoided.

The ISC DHCP server is so configurable I was thinking maybe it was possible.  I wish the documentation had more 
examples.  It took me hours to figure out:
class "NoName" {
         match if not (
                 exists server.ddns-hostname
                 or exists fqdn
                 or exists host-name
         );
         set member_of = "NoName";

         ddns-hostname = concat("NoName-", binary-to-ascii(16, 8, "", substring(hardware, 4, 3)));
         option dhcp.host-name = config-option server.ddns-hostname;
}
which works although I'm not sure everything in the match statement is 100% correct.

I use a couple of variables to I can log decisions:
                         ,"  MemberOf:", pick-first-value(member_of, "(none)")
                         ,"  PoolType:", pick-first-value(pool_type, "(none)")

Bill


On 9/29/2014 4:32 PM, Patrick Trapp wrote:
> I don't know, but honestly, in my case here, I've just included the "match if" from the subgroup again to include the 
> device in the larger group and used comments to indicate what that subgroup was.
>
> I presume you have something that needs to happen to members of some subgroups and something different that needs to 
> happen to members of other subgroups, but you have something in common that needs to happen to all of them?
>
> Patrick
>
> ------------------------------------------------------------------------------------------------------------------------
> *From:* dhcp-users-bounces at lists.isc.org [dhcp-users-bounces at lists.isc.org] on behalf of Bill Shirley 
> [Bill at Henagar.PolymerIndustries.biz]
> *Sent:* Monday, September 29, 2014 3:28 PM
> *To:* Users of ISC DHCP
> *Subject:* Class matching
>
> Is there a way to include a device in a class based on its membership in another class?:
> class "Kyocera" {
>         match if substring(hardware, 1,3) = 00:c0:ee;
>         set member_of = "Kyocera";
> }
> class "Brother" {
>         match if substring(hardware, 1,3) = 30:05:5C;
>         set member_of = "Brother";
> }
>
> Such as:
> class "Printers" {
>         match if (
>             option server.class = "Kyocera"
>             or option server.class = "Brother"
>         );
> }
> if so, what do a replace "option server.class" with?
>
> I've also tried using the variable "member_of" set above:
> class "Printers" {
>        match if (
>                member_of = "Kyocera"
>                or member_of = "Brother"
>        );
> }
> which doesn't work.
>
> TIA,
> Bill
>
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20140929/a7e54a7c/attachment.html>


More information about the dhcp-users mailing list