Assigning host entries to diffrent subnets

Erik Bloodaxe E.Bloodaxe at gold.ac.uk
Mon Oct 1 15:57:51 UTC 2007


Thanks again; however; I am missing something here.

I have cut down my dhcpd.conf to:

		host pxe-client8 { hardware ethernet 00:07:e9:c8:14:7b ;}
		host xxx { hardware ethernet 00:04:75:97:fc:8c ; }
class "pxe-clients" {
	match pick-first-value (hardware);
	#match pick-first-value (option dhcp-client-identifier, hardware);
}

class "gold-portables" {
}
subclass "pxe-clients" 00:07:e9:c8:14:7b ;
subclass "pxe-clients" 00:04:75:97:fc:8c ;
subclass "pxe-clients" "pxe-client8";
subclass "pxe-clients" "xxx";
# ISC dhcpd config file
#
# Log to a dedicated log file
#log-facility local5;
#
authoritative;
shared-network goldall {
	subnet 192.168.129.0 netmask 255.255.255.0 {
		default-lease-time  28800;
		max-lease-time  28800;
		option domain-name-servers 192.168.129.3;
		pool {
			range 192.168.129.10 192.168.129.250;
			deny unknown clients;
		}
	}

	subnet 192.168.64.0 netmask 255.255.255.0 {
		pool {
			range 192.168.64.2 192.168.64.254;
			deny unknown clients;
			allow members of "pxe-clients";
		}
	}

}

but my hosts with the mac addresses in the config file keep getting 129 
range addresses.

So I am not associating the mac addresses with the class correclty?

Reading the man pages dor dhcpd, dhcp-options, and dhcp-eval I cannot 
figure out how to do this

Can some one please assist.

Also a 2nd qustion.   When I have 2 pools that the client matches which 
one does the IP address get assigned from?


regards

Rob


Simon Hobson wrote:
> 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