dhcp with only static leases

Simon Hobson dhcp1 at thehobsons.co.uk
Sun Oct 11 09:34:58 UTC 2009

Sergey Ivanov wrote:
>Hello, I need dhcp configuration which serves ONLY static leases, it
>should not respond to any unknown client.
>Please see config below, is it correct config?

Not far off.

>ignore client-updates;
>ddns-update-style interim;
>ddns-updates off;
>boot-unknown-clients off;
>max-lease-time 100000;
>default-lease-time 84600;
>option routers;
>option domain-name-servers;
>option subnet-mask    ;
>subnet netmask {
>     pool {
>         range;
>         deny unknown-clients;
>         host n192_168_224_77 {
>                 hardware ethernet 00:50:56:c0:00:01;
>                 fixed-address;
>         }
>     }

Two things :

1) You don't need to have a range statement at all - just by leaving 
that out the server will automatically not serve any client without a 
fixed address assignment.

2) You should always put host statements in the global scope. They 
are global in scope, but can inherit options in an unexpected way, so 
apart from some very specialised requirements you should keep them 

Apart from that, a couple of other points. You've defined the routers 
option outside the subnet. In general the only place it makes sense 
is inside a subnet as it's only valid inside that subnet.

And, you've defined the router address as being the same as an 
address that's in the range statement. You state that the gateway is, therefore unless there is something you're not 
telling us about the network, the router option should specify

Thus your config becomes :

option domain-name-servers;
option subnet-mask    ;

subnet netmask {
   option routers;

host n192_168_224_77 {
   hardware ethernet 00:50:56:c0:00:01;

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