How to configure the DHCP to make a priority between the subnets inside same shared network

Simon Hobson dhcp1 at thehobsons.co.uk
Tue Feb 1 13:34:38 UTC 2011


red1 red wrote:

>I configured a shared network containing a multiple subnets , with 
>this actual config , my DHCP is serving the clients with differents 
>IPs from the different subnets randomly, wihtout appliying any order 
>or priority between the subnets, I'd like to configure my DHCP in 
>order to not serve any client from the second subnet until the first 
>subnet if fully used.

The operation you observe is correct. What you want is not and WILL 
break sooner or later.

Once all addresses in one subnet have been used once (even if years 
ago) then the RFCs *REQUIRE* that new clients should get one of the 
unused addresses that will now have to come from the other subnet.

Either:
Your network is setup properly and this is no problem - in which case 
it's no problem the way the server is operating now.
or
It is a problem, in which case your network will break as soon as a 
client needs an address from the other network - you should fix the 
network.


Also, the server does not randomly allocate addresses. They are 
allocated in a very specific order :
1) If the client has ever held a lease with it's current Client-ID 
(or MAC address if no Client-ID was specified) - then the client will 
get that address if it has not be reused since the client was last on 
this network.
2) If there are any "never used" addresses available, then one will 
be allocated in an implementation specific order*.
3) If no 'never used' addresses are left, then a previously used 
address will be re-allocated on a least recently used basis.
4) Any addresses marked abandoned will be re-used.
5) If you get this far - you've run out of addresses to lease !

* At present, due to the internal hashing function used, this is 
numerically "top down" - ie higher numbered addresses are used first.

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the dhcp-users mailing list