Assigning host entries to diffrent subnets

Simon Hobson dhcp1 at thehobsons.co.uk
Mon Oct 1 16:19:58 UTC 2007


Erik Bloodaxe wrote:
>Thanks again; however; I am missing something here.
>
>I have cut down my dhcpd.conf to:
>
>		host pxe-client8 { hardware ethernet 00:07:e9:c8:14:7b ;}
>		host xxx { hardware ethernet 00:04:75:97:fc:8c ; }
>class "pxe-clients" {
>	match pick-first-value (hardware);
>	#match pick-first-value (option dhcp-client-identifier, hardware);
>}
>
>class "gold-portables" {
>}
>subclass "pxe-clients" 00:07:e9:c8:14:7b ;
>subclass "pxe-clients" 00:04:75:97:fc:8c ;
>subclass "pxe-clients" "pxe-client8";
>subclass "pxe-clients" "xxx";
># ISC dhcpd config file
>#
># Log to a dedicated log file
>#log-facility local5;
>#
>authoritative;
>shared-network goldall {
>	subnet 192.168.129.0 netmask 255.255.255.0 {
>		default-lease-time  28800;
>		max-lease-time  28800;
>		option domain-name-servers 192.168.129.3;
>		pool {
>			range 192.168.129.10 192.168.129.250;
>			deny unknown clients;
>		}
>	}
>
>	subnet 192.168.64.0 netmask 255.255.255.0 {
>		pool {
>			range 192.168.64.2 192.168.64.254;
>			deny unknown clients;
>			allow members of "pxe-clients";
>		}
>	}
>
>}
>
>but my hosts with the mac addresses in the config file keep getting 
>129 range addresses.

That's correct, you haven't told the server that these clients CAN'T 
have an address from that pool. If it's an either/or situation then 
you just need to add 'deny members of "pxe-clients";' to the first 
pool. With more classes & pools then it starts getting a bit more 
interesting !


>Also a 2nd qustion.   When I have 2 pools that the client matches 
>which one does the IP address get assigned from?

It's 'undefined'

Officially, if there is more than one pool from which a client can 
get an address, then it is undefined as to what address the client 
will get. However, as implemented at present (version 3.x) AND LIABLE 
TO CHANGE WITHOUT NOTICE, new clients will be given the highest IP 
address which has never been used - ie the server works 'top down' 
through the list of available IPs. It's not deliberately designed 
that way, it's just an effect of the way the memory structures are 
allocated internally.

Once every address has been used at least once, then then it is 
defined. The next address allocated will be the least recently used 
that is in the free state (ie the one whose lease has been expired 
for longest).

Regardless of the above, if the client has previously had an address 
under the same client-ID (or MAC address if no client-ID supplied), 
then it will be given the same address again if it is still available 
(ie it hasn't been reallocated) and is allowable to the client - 
regardless of how long since it last had it.

As a last resort, the server will attempt to recover abandoned 
leases, again on a least recently used basis.



More information about the dhcp-users mailing list