Send dhcp-users mailing list submissions to
[email protected]
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
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."
Today's Topics:
1. Re: DHCPD Leases, no way to clean the file?
([email protected])
2. Re: DHCPD Leases, no way to clean the file? (Jorge Bastos)
3. Re: DHCPD Leases, no way to clean the file? (Simon Hobson)
----------------------------------------------------------------------
Message: 1
Date: Sun, 21 Aug 2022 23:00:05 +1000
From: [email protected]
To: Users of ISC DHCP <[email protected]>
Subject: Re: DHCPD Leases, no way to clean the file?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII; format=flowed
Hi Jorge
This is from the dhcpd.conf man page:
The one-lease-per-client statement
one-lease-per-client flag;
If this flag is enabled, whenever a client sends a
DHCPREQUEST for
a particular lease, the server will automatically free any
other
leases the client holds. This presumes that when the client
sends
a DHCPREQUEST, it has forgotten any lease not mentioned
in the
DHCPREQUEST - i.e., the client has only a single network
interface
and it does not remember leases it's holding on networks to
which
it is not currently attached. Neither of these
assumptions are
guaranteed or provable, so we urge caution in the use of
this
statement.
So you could use:
one-lease-per-client true;
This is not always what you might want though. dhcpd follows the RFC
precisely, and this means that if you connect to a particular subnet it
should try to give you the same IP address as you had last time. Setting
one-lease-per-client means it will forget the leases on other subnets.
This is why it's a settable parameter - the default is the "safer"
option.
The man pages for dhcpd.conf, dhcpd, dhcpd.leases, dhcp-eval are worth
looking at if you haven't
regards,
Glenn
On 2022-08-21 20:03, Jorge Bastos wrote:
> Howdy,
>
> I've started using DHCPD, and noticed that the lease file is not
> "cleaned",
> What I mean is, if some cliente request IP, and get .....11, and after
> two days/another time request again after the lease time ends, and the
> ......11 is already in someone else, it will get a new IP, so far so
> good.
> But the lease file stays with the information about the old lease,
> aswell the new one.
>
> No way to make it have only the new lease for that MACADDRR? for
> example like it does the MSWindows DHCPD.
> I've been searching docs and did not found any information about it,
> but did found people exposing extra large dhcpd.leases file (+1GB),
> aswell others saying that their dhcpd.leases file dont have more than
> 50 or 100kb
>
> Thanks in advanced,
------------------------------
Message: 2
Date: Sun, 21 Aug 2022 17:38:17 +0100
From: Jorge Bastos <[email protected]>
To: Users of ISC DHCP <[email protected]>
Subject: Re: DHCPD Leases, no way to clean the file?
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Hi Glen,
I dig into man dhcpd.conf but missed that, sorry about that.
Undestood the explanation and thank you for that, will stick to the
default.
Jorge,
On 2022-08-21 14:00, [email protected] wrote:
> Hi Jorge
>
> This is from the dhcpd.conf man page:
>
> The one-lease-per-client statement
>
> one-lease-per-client flag;
>
> If this flag is enabled, whenever a client sends a DHCPREQUEST for
> a particular lease, the server will automatically free any other
> leases the client holds. This presumes that when the client sends
> a DHCPREQUEST, it has forgotten any lease not mentioned in the
> DHCPREQUEST - i.e., the client has only a single network interface
> and it does not remember leases it's holding on networks to which
> it is not currently attached. Neither of these assumptions are
> guaranteed or provable, so we urge caution in the use of this
> statement.
>
> So you could use:
>
> one-lease-per-client true;
>
> This is not always what you might want though. dhcpd follows the RFC
> precisely, and this means that if you connect to a particular subnet it
> should try to give you the same IP address as you had last time.
> Setting one-lease-per-client means it will forget the leases on other
> subnets. This is why it's a settable parameter - the default is the
> "safer" option.
>
> The man pages for dhcpd.conf, dhcpd, dhcpd.leases, dhcp-eval are worth
> looking at if you haven't
>
> regards,
> Glenn
>
> On 2022-08-21 20:03, Jorge Bastos wrote:
>
>> Howdy,
>>
>> I've started using DHCPD, and noticed that the lease file is not
>> "cleaned",
>> What I mean is, if some cliente request IP, and get .....11, and after
>> two days/another time request again after the lease time ends, and the
>> ......11 is already in someone else, it will get a new IP, so far so
>> good.
>> But the lease file stays with the information about the old lease,
>> aswell the new one.
>>
>> No way to make it have only the new lease for that MACADDRR? for
>> example like it does the MSWindows DHCPD.
>> I've been searching docs and did not found any information about it,
>> but did found people exposing extra large dhcpd.leases file (+1GB),
>> aswell others saying that their dhcpd.leases file dont have more than
>> 50 or 100kb
>>
>> Thanks in advanced,
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://lists.isc.org/pipermail/dhcp-users/attachments/20220821/6a05d2b8/attachment-0001.htm>
------------------------------
Message: 3
Date: Sun, 21 Aug 2022 21:01:10 +0100
From: Simon Hobson <[email protected]>
To: Users of ISC DHCP <[email protected]>
Subject: Re: DHCPD Leases, no way to clean the file?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Jorge Bastos <[email protected]> wrote:
> I've started using DHCPD, and noticed that the lease file is not "cleaned",
> What I mean is, if some cliente request IP, and get .....11, and after two
> days/another time request again after the lease time ends, and the ......11
> is already in someone else, it will get a new IP, so far so good.
I assume here you mean the client gets an address xx.xx.xx.11 rather than it
gets 11 addresses ?
> But the lease file stays with the information about the old lease, aswell the
> new one.
It will have multiple entries for the same address for a short while - compile
time option, default is one hour between cleanups.
Each hour (default), the server will write out a fresh copy of the leases file
from it?s internal tables. This fresh copy will contain only the most recent
lease for each IP - it will not contain any older versions. Where your leases
file is stored, you?ll see both dhcpd.leases and dhcpd.leases~. The latter is
the previous leases file.
The process used is to write out the new file (to a different temporary file
name); iff that succeeds, then it will rename dhcpd.leases to dhcpd.leases~
(deleting the previous file named dhcpd.lease~), and rename the temporary new
file to dhcpd.leases. It is done this way so that no matter what happens (e.g.
disk full, server crash, power cut, whatever), you will not be left without a
valid leases file.
It may be that for some reason this process is failing (in which case your
leases file will continue to grow until the disk is full), it may be worth
looking into that.
But in normal operation, you should see older lease file entries disappear
after no more than one hour.
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
[email protected]
https://lists.isc.org/mailman/listinfo/dhcp-users
------------------------------
End of dhcp-users Digest, Vol 166, Issue 6
******************************************