DHCP: Any way to set maximum lease time to "infinite" for static mappings?

Started by Asperamanca, February 21, 2021, 05:07:11 PM

Previous topic - Next topic
So the default lease time is one day, even for statically mapped IP addresses. I understand now why my Wifi AP complains once a day that is was disconnected  :)

The ugly solution is to enter a ridiculously high value (2^31 comes to mind, since I don't know whether the value is stored signed or unsigned). As an engineer, this solution is not very satisfying. Is there a default "disable maximum lease time" option?

kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

Interesting. Since I upped the maximum lease time, I no longer my Wifi AP's "device has been disconnected" error once every 24 hours.
Seems like not every device knows it needs to renew the lease...

I've seen this once with a certain Cisco switch. It never renewed its DHCP lease. After the lease expired, the switch was left without an IP address and the management interface became unreachable.
Workaround: One year lease time. ;D

Regarding infinite leases: Setting default-lease-time / max-lease-time in the dhcpd.conf to -1 should have this effect. But I'm not sure whether the OPNsense UI allows this.
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

The maximum setting that fits into a 32bit signed int is more than 60 years. That should do. I also only set this to specific static leases where I encounter these problems.