Bit of help / guidance with a dhcpd.conf file

Japhy Bartlett japhy at pearachute.com
Mon Jun 30 21:27:11 UTC 2008


Hi all -

I'm trying to set up a dhcpd that will hand out IPs in different
ranges, based on a list of known MAC addresses.

As far as I can tell, the following .conf is the most effective way to
do this ( though I would certainly appreciate more elegant solutions
):

###

class "known" {
   match
   if ( binary-to-ascii (16,8,":", substring (option agent.remote-id,2,6) )
        = "00:1b:38:75:a5:ea";
   );
}

shared-network pearachute.net {

authoritative;
option domain-name "bh.pearachute.net";
option domain-name-servers 216.163.32.51, 216.163.32.52,
207.179.71.27, 207.179.70.27;
default-lease-time 600;
max-lease-time 7200;

#This subnet should be statically assigned IPs, for servers, etc.
subnet 192.168.0.0 netmask 255.255.255.0 {
     range 192.168.0.1 192.168.0.2;
     option broadcast-address 192.168.0.255;
   }

## known subnet:
subnet 192.168.1.0 netmask 255.255.255.0 {
     range 192.168.1.1 192.168.1.2;
     option broadcast-address 192.168.1.255;
   }

## public subnet:
   subnet 192.168.2.0 netmask 255.255.255.0 {
     range 192.168.2.1 192.168.2.2;
     option broadcast-address 192.168.2.255;
   }

   pool {
     allow members of "known";
     range 192.168.1.1 192.168.1.254;
   }

pool {
     deny members of "known";
     range 192.168.2.1 192.168.2.254;
   {

}

###

So, restarting gives me:

japhy at c1c1:/var/conf$ sudo dhcpd3 restart
Internet Systems Consortium DHCP Server V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
/etc/dhcp3/dhcpd.conf line 54: right paren expected
        = "00:1b:38:75:a5:ea";
                             ^
/etc/dhcp3/dhcpd.conf line 101: lease 192.168.1.1 is declared twice!
     range 192.168.1.1 192.168.1.254;
                                     ^
/etc/dhcp3/dhcpd.conf line 101: lease 192.168.1.2 is declared twice!
     range 192.168.1.1 192.168.1.254;
                                     ^
/etc/dhcp3/dhcpd.conf line 106: lease 192.168.2.1 is declared twice!
     range 192.168.2.1 192.168.2.254;
                                     ^
/etc/dhcp3/dhcpd.conf line 106: lease 192.168.2.2 is declared twice!
     range 192.168.2.1 192.168.2.254;
                                     ^
Configuration file errors encountered -- exiting

###

No matter how I count it, I can't figure where or why it's expecting
another paren.  I'm hoping this is just something silly.

I guess I understand that it doesn't like two range statements.. but I
don't understand how to tie those together.  Putting the allow/deny
statements in the subnet {} gives different error messages.  I'm not
sure I understand the difference between classes and groups either.

In general, I feel like I'm close - I'm going to try a different
approach using host statements and groups, but I (obviously) have some
more man reading to do.  Any advice or guidance would be very helpful,
and for what it's worth the result will be posted in public for all
the world to see and use.

Thanks for your time,

Japhy


More information about the dhcp-users mailing list