Assigning host entries to diffrent subnets

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Sep 28 14:50:07 UTC 2007


Try this :


Erik Bloodaxe wrote:

>Thanks for this.  I have looked at the man page but need more help. 
>I think you are refering to the secion from Client classing and 
>subclassing in the dhcpd.conf man page.  I have seen this but I 
>cannot find any further information on the syntax of the match 
>commnad.  Can some one assist?
>
>I think you mean set up some sub classes along the lines:
>
>Subclass "subnet1" etheraddress1
>Subclass "subnet1" etheraddress2
>Subclass "subnet1" etheraddress3
>Subclass "subnet2" etheraddress4
>Subclass "subnet2" etheraddress5
>
>and so forth and catch the "subnet"s with a
>
>allow members of "sunbnet1" in appropriate pools.but again I cannot 
>find the full syntax for the allow command.
>
>Can someone point me in the right direction?

 From man dhcpd.conf :

>CLIENT CLASSING
>        Clients  can be separated into classes, and treated differently depend
>        ing on what class they are in.   This separation  can  be  done  either
>        with  a  conditional  statement,  or  with a match statement within the
>        class declaration.   It is possible to specify a  limit  on  the  total
>        number  of  clients within a particular class or subclass that may hold
>        leases at one time, and it is possible to specify automatic subclassing
>        based on the contents of the client packet.
>
>        To  add  clients  to  classes  based on conditional evaluation, you can
>        specify a matching expression in the class statement:
>
>        class "ras-clients" {
>          match if substring (option dhcp-client-identifier, 1, 3) = "RAS";
>        }
>
>        Note that whether you use matching expressions or  add  statements  (or
>        both)  to  classify  clients, you must always write a class declaration
>        for any class that you use.   If there will be no match  statement  and
>        no  in-scope  statements  for a class, the declaration should look like
>        this:
>
>        class "ras-clients" {
>        }
>
>SUBCLASSES
>        In addition to classes, it is possible to declare subclasses.   A  sub
>        class is a class with the same name as a regular class, but with a spe
>        cific submatch expression which is hashed for quick matching.  This  is
>        essentially  a  speed  hack  - the main difference between five classes
>        with match expressions and one class with five subclasses  is  that  it
>        will be quicker to find the subclasses.   Subclasses work as follows:
>
>        class "allocation-class-1" {
>          match pick-first-value (option dhcp-client-identifier, hardware);
>        }
>
>        class "allocation-class-2" {
>          match pick-first-value (option dhcp-client-identifier, hardware);
>        }
>
>        subclass "allocation-class-1" 1:8:0:2b:4c:39:ad;
>        subclass "allocation-class-2" 1:8:0:2b:a9:cc:e3;
>        subclass "allocation-class-1" 1:0:0:c4:aa:29:44;
>
>        subnet 10.0.0.0 netmask 255.255.255.0 {
>          pool {
>            allow members of "allocation-class-1";
>            range 10.0.0.11 10.0.0.50;
>          }
>          pool {
>            allow members of "allocation-class-2";
>            range 10.0.0.51 10.0.0.100;
>          }
>        }


More information about the dhcp-users mailing list