Accidentally Cleared All DHCP Leases
-
I accidentally cleared all of my DHCP Leases in an effort to force a DHCP client reset. Is there any way to get those leases back? I only had 2 leases, one for my switch and one for my desktop. If they aren’t necessary then it’s fine but I just wanted to make sure.
-
@echumbucket they should just normally request the IP they had before when they renew. Which unless some other client takes them before those renew they should just get their old IP on renewal.
If you want to "make sure" devices always have the same IP, setup reservations for them in the dhcp server.
https://docs.netgate.com/pfsense/en/latest/services/dhcp/ipv4.html#static-mappings
-
@johnpoz okay perfect thank you! How often are they scheduled to renew by default?
-
@echumbucket clients will renew at the 50% mark of the lease - what do you have the dhcp lease set too, off the top I don't recall the default.
If the lease was 2 hours, then at 1 hour they would attempt to renew, if they can not at that time they continue to ask at intervals until they do. If it fails to renew, when it expires at the 2 hour mark they would send out a discover for any IP.
If lease 4 hours then at 2 hour mark
if 24 hours, then 12 hours etc. etc..
Once they renew, then the timer resets to the length of the lease again.
Depending on how many clients you have, how often you would like them to renew, or when you want old leases to expire etc. etc. Would determine how long you would want to set your leases for. I have mine set to 4 days.. But that is just me, and how often I want to see clients renew, etc. etc.. That is by no means a recommendation for what you should set.. 2 hours is common, and might be the default?
Pretty much every device on my network has a reservation anyway - so they don't really need to renew etc.. which is part of the reason I have mine set so long..
There are many variables that can come into play when determine the best default lease time for your network. Default is prob fine for almost everyone.. Part of the reason I have mine set that long is just to keep the log with less entries - all renews are logged, etc. ;)
-
@johnpoz Default lease is 7200s/2 hrs.
Also, "Ping check" is enabled by default to try to see if an address is in use before assigning a conflict.