DHCP not releaseing inactive leases
-
DHCP is acting strange and after much troubleshooting it seems to be a bug or something wrong with pfsense setup.
Problem: Old inactive dhcp leases are not recycled even though the device is offline and ping before reuse is active and new users unable to connect and get dhcp ip
When I check the dhcp leases file, I found multiple devices with same IP, isnt the dhcp leases file suppose to update and delete the old unused devices?
Temporary solution is to flush all dhcp leases.
My main dhcp is 192.168.31.0/24 (the 192.168.10.0/24 is testing only)
This is my dhcp config:
option domain-name "removed.forprivacy.arp"; option ldap-server code 95 = text; option domain-search-list code 119 = text; option arch code 93 = unsigned integer 16; # RFC4578 default-lease-time 7200; max-lease-time 86400; log-facility local7; one-lease-per-client true; deny duplicates; update-conflict-detection false; authoritative; class "s_lan" { match pick-first-value (option dhcp-client-identifier, hardware); } subnet 192.168.31.0 netmask 255.255.255.0 { pool { range 192.168.31.7 192.168.31.254; } option routers 192.168.31.1; option domain-name-servers 192.168.31.1; default-lease-time 14400; max-lease-time 43200; ping-check true; } class "s_opt1" { match pick-first-value (option dhcp-client-identifier, hardware); } subnet 192.168.10.0 netmask 255.255.255.0 { pool { range 192.168.10.10 192.168.10.254; } option routers 192.168.10.1; option domain-name-servers 192.168.10.1; ping-check true; }
-
@hakunamatata A lease will remain active until it expires…your screenshot shows several expiring tomorrow. If you have a lot of devices that join briefly try a shorter lease time. Your default lease time is 4h but your screenshot shows all? at 10h, so maybe lower the max lease time also.
-
@steveits if you see the first one in the screenshot, it's already offline and the device left the location so why isn't the ip address being recycled? I thought it recycles automatically and apparently it's not.
-
@hakunamatata its lease ends tomorrow 2:57 am :)
-
@steveits understood. Thanks.
What about the online status and lease type?
I am assuming online status means the device is connected If online and disconnected from the network if offline.
If that's the case, can I write a cron job that if client offline for 2 hours release/delete the lease.
-
@hakunamatata IIRC online means the MAC is in the ARP table meaning it’s had recent activity.
You could just set the lease time to a half hour. Any online devices will renew.
-
working fine. thanks