How does DHCPD determine what IP address to assign and...

Ryan McCain Ryan.McCain at dss.state.la.us
Fri Dec 21 21:07:39 UTC 2007


I might have figured it out.  Unfortunately there is no one here to test due to the holidays:

class "DialUp" {
    match if substring(option vendor-class-identifier, 0, 9) = "ASYNC";
        log (info, " Matched Dialup Rule");
}

subnet 10.116.6.0 netmask 255.255.255.0 {
    pool {
        allow members of "DialUp";
        range 10.116.6.1 10.116.6.8;
        option routers 10.116.6.1;
        }
}

<SNIP>

#VPN
subnet 10.116.6.0 netmask 255.255.255.0 {
  range 10.116.6.9 10.116.6.179 ;
  option routers 10.116.6.1;

...

..Will this reserve IP addresses 10.116.6.1 - 10.116.6.8 for DHCP clients with a UID that contains ASYNC?







>>> On Fri, Dec 21, 2007 at  2:46 PM, in message
<476BD1DB.5D1A.003A.0 at dss.state.la.us>, "Ryan McCain"
<Ryan.McCain at dss.state.la.us> wrote: 
> I found a few posts in the archives but am a bit confused.  I don't know what 
> the 0 and 9 are for and used the example I found as a template.  I am on the 
> right track if I want all DHCP clients that connect w/ the UID containing 
> ASYNC be assigned IP addresses between 10.120.5.100-108 only??
> 
> 
> class "DialUp" {
>     match if substring(option vendor-class-identifier, 0, 9) = "ASYNC";
>         log (info, " Matched Dialup Rule");
>         range 10.120.5.100 10.120.5.108
> }
> 
> ..Thanks..
> 
>>>> On Fri, Dec 21, 2007 at 12:40 PM, in message
> <a06240822c391b86b364d at simon.thehobsons.co.uk>, Simon Hobson
> <dhcp1 at thehobsons.co.uk> wrote: 
>> Ryan McCain wrote:
>> 
>>>1) If I have a defined scope of 10.120.5.1 - 10.120.5.180, whill 
>>>DHCPD hand out .1 to the first DHCPD client, .2 to the second and so 
>>>on?  Or is there another algorithm thats used?
>> 
>> No, officially the initial order is undefined - in practice, the 
>> current implementation will allocate unused leases from the highest 
>> address down for no other reason than the way they are hashed 
>> internally.
>> 
>> Once there are no "never used before" addresses left, addresses are 
>> recovered from expired leases on a least recently used basis.
>> 
>>>2) Is it possible to assign a subset of IP addresses in my scope to 
>>>DHCP clients whos UID identifier contains a specific string?  For 
>>>example, all dialup users have ASYNC in their UID.  We'd like to be 
>>>able to assign them IP addresses 10.120.5.100 - .180.
>> 
>> Yes, see the list archives, and 'man dhcpd.conf' looking for classes 
>> and subclasses.
>> 
>> Very briefly, you define a class which matches on some criteria (such 
>> as the UID starting with ASYNC), then define a pool and only allow 
>> members of the class to use that pool.



More information about the dhcp-users mailing list