Page 1 of 2

Clear DHCP lease cache on the server?

Posted: Sat Dec 09, 2017 6:50 am
by mcinroy
Hello,

I am currently running Amahi 10. I had initially limited the maximum number of dynamic IPs to 50... but I keep running out of IPs. I keep having to "up" the maximum. It seems like the cache keeps growing... perhaps the leases aren't expiring??

I've searched for information on this issue, but can't seem to find any recent relevant discussion. Is this expected behaviour? Should I be manually clearing the cache; if so, how do you accomplish that? I've seen lots of general discussion about how to release/renew IPs from the client; however, (a) many of these clients connected once some time ago and may never connect again, and (b) many of the clients are mobile devices or iot devices, so don't lend themselves to the typical commandline tools for release/renew.

Thanks for any assistance.

Re: Clear DHCP lease cache on the server?

Posted: Tue Jan 09, 2018 5:26 am
by mcinroy
Can anyone comment whether this behaviour -- persistence of DHCP leases -- is expected? or anomalous?

Any suggestions for how to manually clear the lease cache on the server? or even check its contents?

Re: Clear DHCP lease cache on the server?

Posted: Tue Jan 09, 2018 6:03 am
by bigfoot65
Any suggestions for how to manually clear the lease cache on the server? or even check its contents?
Have you updated the OS with the latest packages? I don't recall seeing this behavior in the past.

Also there is guidance on the internet that might help.

Re: Clear DHCP lease cache on the server?

Posted: Mon Jan 22, 2018 10:27 am
by mcinroy
Have you updated the OS with the latest packages? I don't recall seeing this behavior in the past.
I have now. Thanks for the suggestion. For some reason I thought that OS updates between Amahi releases were discouraged... :oops:
Not sure where I got that idea. And there's this, of course:
Amahi Updates - Amahi Wiki
:oops:

Anyway...
Also there is guidance on the internet that might help.
I had searched, pretty extensively, for information on Fedora and dhcp server leasetime, before posting the question originally...
Everything I've found points to the leases being cached in /var/lib/dhcpd/dhcpd.leases... and the configuration being kept in /etc/dhcp/dhcpd/conf... but neither of those exist on my HDA. And there doesn't seem to be a dhcpd daemon running.

Does Amahi use something different to accomplish DHCP?
Can you suggest where to find the configuration on an Amahi instance?

Re: Clear DHCP lease cache on the server?

Posted: Mon Jan 22, 2018 12:58 pm
by bigfoot65
And there's this, of course:
Amahi Updates - Amahi Wiki
:oops:
Yes disabled by default as many users wanted control over updates. It does not say anything about updates being discouraged.
Does Amahi use something different to accomplish DHCP?
Amahi uses dnsmasq for DNS and DHCP capabilities.

Re: Clear DHCP lease cache on the server?

Posted: Tue Jan 23, 2018 8:02 am
by mcinroy
And there's this, of course:
Amahi Updates - Amahi Wiki
:oops:
Yes disabled by default as many users wanted control over updates. It does not say anything about updates being discouraged.
No, that "discouraged" part was all in my head... hence the :oops: .

Does Amahi use something different to accomplish DHCP?
Amahi uses dnsmasq for DNS and DHCP capabilities.
Ahh. Perfect. Yes. I see now that dnsmasq is referenced in a few Amahi wiki articles... for some reason I hadn't found that info when looking for DHCP info. That was precisely the piece of information that I needed. Thank you!

Re: Clear DHCP lease cache on the server?

Posted: Tue Jan 23, 2018 9:02 am
by bigfoot65
Happy to assist.

Maybe once you sort this out, you could add some guidance to the wiki. We would greatly appreciate it.

Should we mark this closed?

Re: Clear DHCP lease cache on the server?

Posted: Tue Jan 23, 2018 12:44 pm
by mcinroy
Happy to assist.

Maybe once you sort this out, you could add some guidance to the wiki. We would greatly appreciate it.
Sure. If you could suggest which article would be relevant -- or let me know if there should be a new wiki entry -- I'd be happy to do it.
Should we mark this closed?
Ehh... i still haven't done anything to clear the cache and/or prove that IPs are getting re-used. I'll try to work on that in the next day or so.

Re: Clear DHCP lease cache on the server?

Posted: Tue Jan 23, 2018 5:23 pm
by bigfoot65
I’d create a new wiki entry. If I find a better place I can move it later.

Re: Clear DHCP lease cache on the server?

Posted: Mon Jan 29, 2018 2:37 am
by mcinroy
@bigfoot65 I think this thread can be closed now.

It seems that the system updates were what I was missing, leases are being reused now. I have dropped the maximum number of dynamic IPs to a reasonable number and everyone seems to be getting an address without trouble (as one would hope).

So, I didn't really have to do anything ground-breaking... but perhaps there are some tidbits that could go into a wiki article -- location of the lease file (relate that back to the Amahi Network Setup UI)... After searching the wiki for dnsmasq, I found some good info under Troubleshooting. Perhaps there could be a mention of Amahi's use of dnsmasq earlier in the docs, say, here?:
https://wiki.amahi.org/index.php/HDA_Ad ... Networking

Initially, when I was looking into this, googling "fedora dhcp server lease" always pointed me to /var/lib/dhcpd/dhcpd.leases as the location for the lease file. Obviously, it's not there in our case, so I was stymied.

What do you think?