Assigning host entries to diffrent subnets

Glenn Satchell Glenn.Satchell at uniq.com.au
Tue Oct 2 13:16:00 UTC 2007


>Date: Mon, 01 Oct 2007 16:57:51 +0100
>From: Erik Bloodaxe <E.Bloodaxe at gold.ac.uk>
>To: dhcp-users at isc.org
>Subject: Re: Assigning host entries to diffrent subnets
>X-Goldsmiths-MailScanner-Information: See 
http://www.gold.ac.uk/infos/cs/mailscanner/ for more information
>X-Goldsmiths-MailScanner: Found to be clean
>X-MailScanner-From: e.bloodaxe at gold.ac.uk
>X-archive-position: 4733
>X-ecartis-version: Ecartis v1.0.0
>X-original-sender: E.Bloodaxe at gold.ac.uk
>List-software: Ecartis version 1.0.0
>X-List-ID: <dhcp-users.isc.org>
>X-list: dhcp-users
>
>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";
>
>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.

Hi Rob

To answer the first question. In this example from the sub-class section of 
dhcpd.conf man page it shows an example match line and a few sub-classes

       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;

Note that the sub-class contains what looks like an ethernet address,
but it is 7 octets... As we are matching on hardware, the definition
for this value is in the dhcp-eval man page:

     hardware

       The hardware operator returns a data  string  whose  first
       element  is  the  type  of  network interface indicated in
       packet being considered, and whose subsequent elements are
       client's  link-layer  address.   If there is no packet, or
       if the RFC2131 hlen field is invalid, then the  result  is
       null.    Hardware  types  include ethernet (1), token-ring
       (6), and fddi (8).
       
So to specify the hardware we need to put a hardware type value
(usually 1 for ethernet these days) followed by the mac address. Thus,
what you need in your dhcpd.conf is:

class "pxe-clients" {
	match hardware;
}
subclass "pxe-clients" 1:00:07:e9:c8:14:7b ;
subclass "pxe-clients" 1:00:04:75:97:fc:8c ;

hth.

regards,
-glenn


More information about the dhcp-users mailing list