Send dhcp-users mailing list submissions to
        dhcp-users@lists.isc.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/dhcp-users
or, via email, send a message with subject or body 'help' to
        dhcp-users-requ...@lists.isc.org

You can reach the person managing the list at
        dhcp-users-ow...@lists.isc.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."


Today's Topics:

   1. expected behavior of 'static' leases/reservations with
      infinite-is-reserved (Stephan Seeger)
   2. Re: expected behavior of 'static' leases/reservations with
      infinite-is-reserved (Simon)


----------------------------------------------------------------------

Message: 1
Date: Tue, 4 Jan 2022 21:54:33 +0100
From: Stephan Seeger <stephansee...@gmx.net>
To: dhcp-users@lists.isc.org
Subject: expected behavior of 'static' leases/reservations with
        infinite-is-reserved
Message-ID: <99acabdc-2b88-f227-dace-49c22acb2...@gmx.net>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi everybody,

I'm running isc-dhcp-server4.4.1 on a Ubuntu 20.04.3 LTS system in a
ddns config in conjunction with a BIND 9.16.1 and have a question
regarding the 'infinite-is-reserved' directive:

 From what I've read in the docs and various internet sources my
understanding is that setting the directive globally to 'on' in
dhcpd.conf I should be able to have host entries with 'infinite'
leasetimes that serve as 'static' leases/reservations (even) within a
dynamic range.

Respective lines in my dhcpd.conf look like this:


xxxxxxxxxxxxxxxxxx?? snip ? xxxxxxxxxxxxxxxxxx

...

infinite-is-reserved on;

...

subnet 172.16.1.0 netmask 255.255.255.0 {
 ?range 172.16.1.10 172.16.1.199;
 ?option subnet-mask 255.255.255.0;
 ?option routers 172.16.1.1;
 ?option broadcast-address 172.16.1.255;
 ?host test {
 ? hardware ethernet de:ad:be:ef:de:ad;
 ? fixed-address 172.16.1.200;
 ? min-lease-time 4294967295;
 ? max-lease-time 4294967295;
 ?}

...

}

xxxxxxxxxxxxxxxxxx?? snip ? xxxxxxxxxxxxxxxxxx


 From some source I read that these 'static' leases would be processed
by dhcpd's state engine like normal dynamic leases - but at least in my
case this doesn't seem to be true. Doing a tail -f on my servers
/var/lib/dhcp/dhcpd.leases file I was never able to have a lease
generated for host 'test' in above setting - and also not with following
modifications of the host definition:

 ?host test {
 ? hardware ethernet de:ad:be:ef:de:ad;
 ? fixed-address 172.16.1.200;
 ? min-lease-time -1;
 ? max-lease-time -1;
 ?}

...or...

 ?host test {
 ? hardware ethernet de:ad:be:ef:de:ad;
 ? fixed-address 172.16.1.200;
 ? min-lease-time 2147483647;
 ? max-lease-time 2147483647;
 ?}

Seems like the 'fixed-address' directive in the host definition prevents
the server from generating an entry in the leases-file.

Can anybody please clarify whether this is expected behavior or not or
what I'm doing wrong here and point me into the right direction?

PS: I did not verify until now but would suspect that also ddns for my
host 'test' is not possible when there's no lease generated, correct?


Best regards

Stephan









------------------------------

Message: 2
Date: Tue, 4 Jan 2022 21:07:42 +0000
From: Simon <dh...@thehobsons.co.uk>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: expected behavior of 'static' leases/reservations with
        infinite-is-reserved
Message-ID: <35377917-3874-44ee-9ddc-2d73ffd98...@thehobsons.co.uk>
Content-Type: text/plain;       charset=utf-8

Stephan Seeger <stephansee...@gmx.net> wrote:

> From what I've read in the docs and various internet sources my
> understanding is that setting the directive globally to 'on' in
> dhcpd.conf I should be able to have host entries with 'infinite'
> leasetimes that serve as 'static' leases/reservations (even) within a
> dynamic range.
> 
> Respective lines in my dhcpd.conf look like this:
> 
> 
> xxxxxxxxxxxxxxxxxx   snip   xxxxxxxxxxxxxxxxxx
> 
> ...
> 
> infinite-is-reserved on;
> 
> ...
> 
> subnet 172.16.1.0 netmask 255.255.255.0 {
>  range 172.16.1.10 172.16.1.199;
>  option subnet-mask 255.255.255.0;
>  option routers 172.16.1.1;
>  option broadcast-address 172.16.1.255;
>  host test {
>   hardware ethernet de:ad:be:ef:de:ad;
>   fixed-address 172.16.1.200;
>   min-lease-time 4294967295;
>   max-lease-time 4294967295;
>  }

First VERY common mistake.
Host statements are global in scope no matter where you put the declaration, 
BUT if put anywhere but the global scope can have some ?interesting? option 
inheritance issues. Do yourself a favour and put all host declarations in the 
global scope. Not related to your query, but we have seen issues caused by it.


> From some source I read that these 'static' leases would be processed
> by dhcpd's state engine like normal dynamic leases - but at least in my
> case this doesn't seem to be true. Doing a tail -f on my servers
> /var/lib/dhcp/dhcpd.leases file I was never able to have a lease
> generated for host 'test' in above setting - and also not with following
> modifications of the host definition:
> 
>  host test {
>   hardware ethernet de:ad:be:ef:de:ad;
>   fixed-address 172.16.1.200;
>   min-lease-time -1;
>   max-lease-time -1;
>  }
> 
> ...or...
> 
>  host test {
>   hardware ethernet de:ad:be:ef:de:ad;
>   fixed-address 172.16.1.200;
>   min-lease-time 2147483647;
>   max-lease-time 2147483647;
>  }
> 
> Seems like the 'fixed-address' directive in the host definition prevents
> the server from generating an entry in the leases-file.

Correct, a host statement with a fixed address is treated very differently to a 
dynamic address. The normal lease lifecycle is not followed and no lease entry 
will ever be created.

> PS: I did not verify until now but would suspect that also ddns for my
> host 'test' is not possible when there's no lease generated, correct?

Dynamic DNS will work, but you have to set an option - something like 
update-static-leases (check the docs). If you set this, then DNS will be 
updated on every lease renewal, and the entries will never be removed (because 
there?s no lease to expire).


To answer your query, I think what you need to do is to config for a client to 
be offered a ?dynamic? lease with an ?infinite? lifetime. It may be as simple 
as just removing the fixed-address statement from your config. If I sound a bit 
vague, it?s because this is a feature I?ve never used.


Simon




------------------------------

Subject: Digest Footer

_______________________________________________
ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
dhcp-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users


------------------------------

End of dhcp-users Digest, Vol 159, Issue 1
******************************************

Reply via email to