DHCP client takes too much time to get IP address

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Nov 15 19:06:49 UTC 2007


Alessandro FAGLIA wrote:

>>>subnet 192.168.1.0 netmask 255.255.255.0 {
>>>   option routers 192.168.1.1;
>>>   option subnet-mask 255.255.255.0;
>>>   option broadcast-address 192.168.1.255;
>>>   option domain-name-servers 192.168.1.1;
>>>
>>>   # guests with unknown MAC addr
>>>   pool {
>>>     range 192.168.1.170 192.168.1.179;
>>>     allow unknown clients;
>>>   }
>>>
>>>   # guests with known MAC addr
>>>   pool {
>>>     range 192.168.1.180 192.168.1.199;
>>>   }
>>>}
>
>Then the subnet declaration I forgot to paste in my previous post:
>
>subnet 192.168.2.0 netmask 255.255.255.0 {
>   option routers 192.168.2.1;
>   option subnet-mask 255.255.255.0;
>   option broadcast-address 192.168.2.255;
>   option domain-name-servers 192.168.2.1;
>}
>
>>>
>>>group {
>>>   default-lease-time 43200;
>>>   max-lease-time 86400;
>>>   option netbios-name-servers 192.168.1.1;
>>>   use-host-decl-names on;
>>>
>>>   host <...> {
>>>     hardware ethernet <...>;
>>>     fixed-address 192.168.1.20;
>>>   }
>>>[...]
>>>}
>>>
>>># Guests with known MAC addr
>>>group {
>>>   default-lease-time 43200;
>>>   max-lease-time 86400;
>>>   use-host-decl-names on;
>>>
>>>   host <...> {
>>>     hardware ethernet <..>;
>>>     fixed-address 192.168.1.180;
>>>   }
>>>[...]
>>>}
>>>
>>>group {
>>>   default-lease-time 43200;
>>>   max-lease-time 86400;
>>>   option netbios-name-servers 192.168.2.1;
>>>   use-host-decl-names on;
>>>
>>>   host <...> {
>>>     hardware ethernet <...>;
>>>     fixed-address 192.168.2.50;
>>>   }
>>>}



>>Firstly you are missing a subnet declaration. You MUST define the 
>>192.168.2.0/24 subnet even if you do not issue any leases to it. As 
>>you have a shared network, you must declare it as such :
>>
>>shared-network somenetworkname {
>>   subnet 192.168.1.0 ....
>>     ....
>>   }
>>   subnet 192.168.2.0 ....
>>     ....
>>   }
>>}
>>
>
>This is something I've completely missed...
>I am now reading the dhcpd.conf man page referring to this statement.
>
>>
>>Also, you has a fixed address (192.168.1.180) which is also part of 
>>a dynamic range. Any fixed address MUST NOT be in any dynamically 
>>assignable range. It is possible that a dynamic client could 
>>acquire the address, then the host with the fixed address come onto 
>>the network. The server will comply with your instruction to give 
>>the host it's fixed address and you then have two stations with an 
>>address comflict.
>
>I agree with you, but the "allow unknown clients" should restrict 
>addresses to the range (192.168.1.170-192.168.1.179) specified in 
>the parent pool. Isn't it?
>
>Should I avoid the pool declaration for 192.168.1.180-192.168.1.199 range?

Well the first thing is that I now see that the range in question has 
no limitation on it - so unknown clients can get addresses from it. 
The default is that anything is allowed.

If all the addresses in that range are allocated by fixed address 
statements in host declarations then it is redundant and you would 
probably want to remove it. In general, if you don't want an address 
allocated dynamically to a client, don't include it in a range 
statement.



More information about the dhcp-users mailing list