DHCP "static" assignments

Glenn Satchell glenn.satchell at uniq.com.au
Thu Aug 8 08:32:11 UTC 2013


On Thu, August 8, 2013 6:57 am, Chris Buxton wrote:
>
> On Aug 7, 2013, at 1:39 PM, Gregory Sloop <gregs at sloop.net> wrote:
>
>> Here's the effect I want...
>>
>> I want the DHCP server to hand out specific IP's to specific MAC
>> addresses, [as defined in the host record.]
>>
>> They're static DHCP assignments, not static IP clients.
>> ---
>> i.e. I want 10.0.0.10 to get assigned *via the DHCP server* to the
>> host with MAC Address aa:bb:cc:dd:ee:ff
>>
>> Also, I'm assigning via DHCP addresses from 10.0.0.1-10.0.0.20 to
>> anyone who asks via DHCP.
>>
>> The way I do it now, is assign pools as follows
>>
>> 10.0.0.1-10.0.0.9 && set "allow unknown-hosts"
>> 10.0.0.10 && set "deny unknown-hosts"
>> 10.0.0.11-10.0.0.20 && set "allow unknown-hosts"
>>
>> AND create a host entry for 10.0.0.10 like so:
>>
>> host somehost {
>>        hardware ethernet aa:bb:cc:dd:ee:ff;
>>        fixed-address 10.0.0.10;
>>        }
>>
>> ---
>>
>> I *think* I have to include the relevant IP in a pool. (In this case
>> 10.0.0.10)  [If there's no pool with 10.0.0.10 in it, the DHCP server
>> won't hand out an IP for 10.0.0.10, no matter what host record there
>> is, will it?]
>
> Yes it will. You do not need a pool surrounding your reserved address.
>
> Something like this should work:
>
> host somehost {
> 	hardware ethernet aa:bb:cc:dd:ee:ff;
> 	fixed-address 10.0.0.10;
> }
>
> subnet 10.0.0.0 netmask 255.255.255.0 {
> 	<options>
> 	pool {
> 		range 10.0.0.1 10.0.0.9;
> 		range 10.0.0.11 10.0.0.20;
> 	}
> }
>
> Regards,
> Chris Buxton

If you assign an IP via a fixed-address in a host block, then you *must*
*not* put that IP in any range statement in any pool or subnet.

The fixed-address is sufficient to assign that IP to the client.

If you also put it in a pool (or rather a range statement) then you're
telling the dhcpd server it is allowed to hand it out to any other client
if it matches the access rules for that pool. For example, you could have
many 'known clients' that match. Normally this will work *if* the client
is powered on and responds to a ping the dhcp server sends before
assigning the IP address to a client.

Assigning by fixed-address or a range is a "one or the other but not both"
type of option.

regards,
-glenn




More information about the dhcp-users mailing list