Configuration question..

B. Cook bcook at poklib.org
Tue Sep 12 16:38:39 UTC 2006


Glenn Satchell wrote:
>> To: dhcp-users at isc.org
>> Subject: Re: Configuration question..
>> From: Keith.Neufeld at wichita.edu
>> Date: Tue, 12 Sep 2006 09:20:54 -0500
>>
>>> . . .
>>>
>>> The webmin gui doesn't show us the defined hosts we have, and we can't 
>>> figure out where/how to add them.. so I started to think that somehow 
>>> our config is incorrect..
>>>
>>> . . .
>>>
>>> We use hosts in pools, b/c I have one setup for unknown clients and one 
>>> for known clients.. and well, in the pools I can't see the defined hosts 
>>> that we have in the webmin gui.
>> The fact that the host declarations are inside the pool declaration is 
>> actually irrelevant to whether they can get a lease from that pool or 
>> not--the determination is made (in your configuration) by whether they're 
>> known (listed anywhere in the configuration) or unknown.
>>
>> To demonstrate that, take the host declaration for ronlapbop [sic] and 
>> move it to the 10.0.0.0 "Public Network" section of your configuration, 
>> then try to boot it on your 192.168.1.0 subnet.  It'll still get an 
>> address from one of your known-host ranges, _not_ from the 192.168.1.20-25 
>> range for unknown clients.
>>
>> There's been a thread on the mailing list recently about proper placement 
>> of host declarations; but the common wisdom is to put them _outside_ of 
>> all blocks, in the global scope, UNLESS you specifically want them to use 
>> some of the options from their "home" subnet even when they're roaming to 
>> other subnets.  [Did I say that about right?]  Putting host declarations 
>> inside subnet or pool declarations can lead people to think the hosts are 
>> tied to getting addresses only from the subnet or pool (which isn't 
>> actually the case), so it's nicer to put them globally and avoid the 
>> confusion.
>>
>>
>> It may be just the way my browser is displaying the file, but I prefer 
>> indenting blocks visually to match their syntactic nesting--so it'd be 
>> easier for me to read quickly if e.g. the stuff inside the 10.0.0.65-94 
>> pool were indented by another tabstop, and the hosts inside it (if they 
>> stay there) indented two tabstops from where they appear now.
>>
>> My $.02.
> 
> One other idea is to use the group { } function when you have some
> common options for different groups of hosts. See below.
> 
> I also agree with the wisdom of moving the host declarations to the
> global scope. They will still pick up appropriate subnet and pool
> settings based on whichever subnet or pool they get assigned an address
> from. I would venture to say this seems to be the collective "best
> practice" of the mailing list.
> 
> I would then move the option settings from the pool to the subnet scope.
> 
> The file would start to look a bit like this:
> 
> #global options
> 
> group {
>   option routers 0.0.0.0;
>   host ... { }
>   host ... { }
> }
> host ... { }
> host ... { }
> 
> subnet 192.168.1.0 netmask 255.255.255.0 {
>     option domain-name "adriance.poklib.org"; 
>     option domain-name-servers 192.168.1.2;
>     option netbios-name-servers 192.168.1.248;
>     option netbios-node-type 8;
>     #option netbios-node-type 4;
>     option routers 192.168.1.3;
>     #option routers 192.168.1.2;
> 
>     pool {
>         deny unknown clients;
>         range ...
>         ...
>     } # close pool
> } # close subnet
> 
> subnet 10.0.0.0 netmask 255.255.255.128 {
>     option ...
>     range ...
>     allow unknown clients;
> }
> 
> You have authoritative in the global scope, so no need to repeat it in
> subnet or pool scopes.
> 
> My two cents worth, hope it helps.
> 
> regards,
> -glenn
> --
> Glenn Satchell       mailto:glenn.satchell at uniq.com.au  |  Heard about
> Uniq Advances Pty Ltd           http://www.uniq.com.au  |  the new Unix
> PO Box 70 Paddington NSW Australia 2021                 |  sports car?
> tel:0409-458-580   tel:02-9380-6360   fax:02-9380-6416  |  The  rwx
> 
> 

Ok,

so something like this:

http://poklib.org/~bcook/dhcpd.conf

with this config I get a WARNING now when I restart my dhcpd..

/usr/local/etc/rc.d/isc-dhcpd restart
Stopping dhcpd.
Starting dhcpd.
Internet Systems Consortium DHCP Server V3.0.5rc2
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
WARNING: Host declarations are global.  They are not limited to the 
scope you declared them in.
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 82 leases to leases file.
Listening on BPF/fxp0/00:e0:18:03:d0:3c/192.168.1/24
Sending on   BPF/fxp0/00:e0:18:03:d0:3c/192.168.1/24
Sending on   Socket/fallback/fallback-net

and everything still seems normal..




More information about the dhcp-users mailing list