long expired DHCPD leases still in dhcpd.leases file

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

long expired DHCPD leases still in dhcpd.leases file

schilling
When DHCPD write lease from memory to disk, there is no cleaning done? Or I am missing a configuration flag for that? 

We have one pair of DHCP servers which have been migrated several times to new pairs over the years. Currently running on RHEL7 with DHCP 4.2.5. We recently found out that there are a lot of expired leases from several years ago are still in the lease file. For example, there are about 2 millions leases in the file, but 32K leases have lease ends times in 2014, 2015, and 2016. 

We had database out of sync from secondary to primary issue, namely, both member is claiming the other member is holding all the free leases. It will get fixed after "faulting the database" https://kb.isc.org/article/AA-00609/0/How-do-I-resynchronize-a-failover-pair.html. We are suspecting these leases might contribute to the issue. 

Best,

Schilling



 

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: long expired DHCPD leases still in dhcpd.leases file

Bill Shirley-2
What "cleaning" do you expect?  If those addresses are still defined in dhcpd.conf
the DHCPD will keep track of them no matter when they were last used.

Bill


On 12/14/2017 4:04 PM, schilling wrote:
When DHCPD write lease from memory to disk, there is no cleaning done? Or I am missing a configuration flag for that? 

We have one pair of DHCP servers which have been migrated several times to new pairs over the years. Currently running on RHEL7 with DHCP 4.2.5. We recently found out that there are a lot of expired leases from several years ago are still in the lease file. For example, there are about 2 millions leases in the file, but 32K leases have lease ends times in 2014, 2015, and 2016. 

We had database out of sync from secondary to primary issue, namely, both member is claiming the other member is holding all the free leases. It will get fixed after "faulting the database" https://kb.isc.org/article/AA-00609/0/How-do-I-resynchronize-a-failover-pair.html. We are suspecting these leases might contribute to the issue. 

Best,

Schilling



 


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: long expired DHCPD leases still in dhcpd.leases file

glenn.satchell
The dhcp RFCs state that a DHCP server must try hard to return the IP
address a client previously used. So when the leases file is periodically
re-written the newest lease for each IP address is retained.

If required, the DHCP server will hand those IPs out to a new client if
there are no other free leases available.

All it indicates is that you have enough free IP addresses in the dynamic
ranges so the server has not needed to use those old ones.

I guess you could clean them out if you knew (or didn't care) if that
client was coming back. In that case, stop the dhcp server, modify the
leases file, then start it up again. I imagine you would want a script to
do the editting quickly.

regards,
-glenn


On Fri, December 15, 2017 5:22 pm, Bill Shirley wrote:

> What "cleaning" do you expect?  If those addresses are still defined in
> dhcpd.conf
> the DHCPD will keep track of them no matter when they were last used.
>
> Bill
>
>
> On 12/14/2017 4:04 PM, schilling wrote:
>> When DHCPD write lease from memory to disk, there is no cleaning done?
>> Or I am missing a configuration flag for that?
>>
>> We have one pair of DHCP servers which have been migrated several times
>> to new pairs over the years. Currently running on
>> RHEL7 with DHCP 4.2.5. We recently found out that there are a lot of
>> expired leases from several years ago are still in the
>> lease file. For example, there are about 2 millions leases in the file,
>> but 32K leases have lease ends times in 2014, 2015,
>> and 2016.
>>
>> We had database out of sync from secondary to primary issue, namely,
>> both member is claiming the other member is holding all
>> the free leases. It will get fixed after "faulting the database"
>> https://kb.isc.org/article/AA-00609/0/How-do-I-resynchronize-a-failover-pair.html.
>> We are suspecting these leases might
>> contribute to the issue.
>>
>> Best,
>>
>> Schilling
>>
>>
>>
>>
>>
>> _______________________________________________
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: long expired DHCPD leases still in dhcpd.leases file

schilling
Thanks for the clarification. After reading your reply, I also found the following past thread which has more details.
 

how dhcp-server select a ip-address to client?


On Fri, Dec 15, 2017 at 3:25 AM, Glenn Satchell <[hidden email]> wrote:
The dhcp RFCs state that a DHCP server must try hard to return the IP
address a client previously used. So when the leases file is periodically
re-written the newest lease for each IP address is retained.

If required, the DHCP server will hand those IPs out to a new client if
there are no other free leases available.

All it indicates is that you have enough free IP addresses in the dynamic
ranges so the server has not needed to use those old ones.

I guess you could clean them out if you knew (or didn't care) if that
client was coming back. In that case, stop the dhcp server, modify the
leases file, then start it up again. I imagine you would want a script to
do the editting quickly.

regards,
-glenn


On Fri, December 15, 2017 5:22 pm, Bill Shirley wrote:
> What "cleaning" do you expect?  If those addresses are still defined in
> dhcpd.conf
> the DHCPD will keep track of them no matter when they were last used.
>
> Bill
>
>
> On 12/14/2017 4:04 PM, schilling wrote:
>> When DHCPD write lease from memory to disk, there is no cleaning done?
>> Or I am missing a configuration flag for that?
>>
>> We have one pair of DHCP servers which have been migrated several times
>> to new pairs over the years. Currently running on
>> RHEL7 with DHCP 4.2.5. We recently found out that there are a lot of
>> expired leases from several years ago are still in the
>> lease file. For example, there are about 2 millions leases in the file,
>> but 32K leases have lease ends times in 2014, 2015,
>> and 2016.
>>
>> We had database out of sync from secondary to primary issue, namely,
>> both member is claiming the other member is holding all
>> the free leases. It will get fixed after "faulting the database"
>> https://kb.isc.org/article/AA-00609/0/How-do-I-resynchronize-a-failover-pair.html.
>> We are suspecting these leases might
>> contribute to the issue.
>>
>> Best,
>>
>> Schilling
>>
>>
>>
>>
>>
>> _______________________________________________
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users