Classing clients by their Hardware Ethernet Address

Glenn Satchell Glenn.Satchell at uniq.com.au
Tue Jan 8 14:35:57 UTC 2008


>Date: Mon, 07 Jan 2008 17:50:11 +0100
>From: Tarik Gasmi <isnogoud at web.de>
>To: dhcp-users at isc.org
>Subject: Classing clients by their Hardware Ethernet Address
>
>Hello,
>
>is it possible to class clients by matching the MAC-Address they are
>sending? I don't want to use the dhcp-client-identifier option for that
>purpose because a uge number of clients is served and i cannot be sure
>which type identification option they send in their message ...
>
>I later want to use this class to allow a specified group of clients to
>get dynamic addresses form a pool ...
>
>i would like to do it this way:
>
>
>*** snip ***
>class "some-clients" {
>   match hardware ethernet;   (and not: option dhcp-client-identifier)
>}
>subclass "some-clients" 00:00:aa:aa:aa:aa;
>subclass "some-clients" 00:01:bb:bb:bb:bb;
>subclass "some-clients" 00:02:cc:cc:cc:cc;
>subclass "some-clients" 00:03:dd:dd:dd:dd;
>subclass "some-clients" ...
>...
>*** snap ***
>
>and use it in a pool declaration
>
>*** snip ***
>pool {
>   range ip1 ip2;
>   allow members of "some-clients";
>}
>*** snap ***
>
>
>Or are there better solutions?
>
>Thank you in advance, and best regards
>
>Tarik
>
There is an example under SUB-CLASSES in the man page, that is very similar to 
this. You could do it like this:

     class "some-clients" {
       match hardware;
     }

     subclass "some-clients" 1:8:0:2b:4c:39:ad;

Note the 1 added in front of the mac address - this is a hardware type
and 1 is ethernet, so you need that in your sub-classes.

If you have many clients you may also want to set up the match on a
sub-string of the mac address, eg:

     class "some-clients" {
       match substring(hardware, 1, 3);
     }

     subclass "some-clients" 8:0:2b;

which would match all the clients with the same NIC vendor. man dhcp-eval
has details on substring().

regards,
-glenn


More information about the dhcp-users mailing list