DHCP config

Glenn Satchell Glenn.Satchell at uniq.com.au
Mon Jun 25 16:13:11 UTC 2007

man dhcp-eval
     substring (data-expr, offset, length)

       The substring operator evaluates the data  expression  and
       returns  the  substring  of  the result of that evaluation
       that starts offset bytes from  the  beginning,  continuing
       for  length  bytes.   Offset  and  length are both numeric

       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).   Hardware types are specified  by  the
       IETF,  and details on how the type numbers are defined can
       be found in RFC2131 (in the ISC DHCP distribution, this is
       included in the doc/ subdirectory).

So the hardware operator returns 01:00:02:02:x:y:z for your ethernet
devices.  You can match on either

  substring( hardware, 0, 4 ) = 01:00:02:02;
  substring( hardware, 1, 3 ) = 00:02:02;


>From: "Gideon Viator" <ktcisg at kaplantel.net>
>Sry guys,
>Should I put a 1 or 0 after hardware?
>Gideon Viator
>IT Administrator 
>Kaplan Telecommunications
>-----Original Message-----
>From: dhcp-users-bounce at isc.org [mailto:dhcp-users-bounce at isc.org] On Behalf
>Of Bruce Hudson
>Sent: Monday, June 25, 2007 10:30 AM
>To: dhcp-users at isc.org
>Subject: Re: DHCP config
>> class "amino" {
>>   match if substring( hardware, 0, 3 ) = 00:02:02; 
>> }
>    If I recall correctly, you want "substring( hardware, 1, 3 )". You want
>to skip the first byte of the hardware field, which is a "1" to specify an
>ethernet address.
>Bruce A. Hudson				| Bruce.Hudson at Dal.CA
>UCIS, Networks and Systems		|
>Dalhousie University			|
>Halifax, Nova Scotia, Canada		| (902) 494-3405

More information about the dhcp-users mailing list