OPNsense Forum

English Forums => 26.1, 26,4 Series => Topic started by: Diggy on March 25, 2026, 07:50:23 PM

Title: Override DHCP Valid Lifetime
Post by: Diggy on March 25, 2026, 07:50:23 PM
We're using Kea DHCP server.  The Valid Lifetime set on the Settings tab is sufficient for most of our subnets.  However, there are a couple subnets that require a shorter lease time.

Which Option code, if any, overrides the value set on the Settings tab?  There isn't a code that says "valid lifetime".  The closest I found is "renewal time [58]", but because this is a production router, I cannot do trial and error.  Is "renewal time [58]" the correct code to overrride default valid lifetime?

UPDATE:
The code I mentioned above is for IPv4.  I also need the correct code for IPv6.  Please and thanks.

Title: Re: Override DHCP Valid Lifetime
Post by: hharry on March 26, 2026, 07:30:55 AM
Quote from: Diggy on March 25, 2026, 07:50:23 PMWe're using Kea DHCP server.  The Valid Lifetime set on the Settings tab is sufficient for most of our subnets.  However, there are a couple subnets that require a shorter lease time.

Which Option code, if any, overrides the value set on the Settings tab?  There isn't a code that says "valid lifetime".  The closest I found is "renewal time [58]", but because this is a production router, I cannot do trial and error.  Is "renewal time [58]" the correct code to overrride default valid lifetime?

UPDATE:
The code I mentioned above is for IPv4.  I also need the correct code for IPv6.  Please and thanks.



kea claims to support per subnet valid-lifetime config option https://kea.readthedocs.io/en/kea-3.0.2/arm/dhcp4-srv.html#shared-networks-in-dhcpv4, however isn't exposed in OPNsense UI, perhaps consider raising a new feature request ?

It's been requested before here -> https://github.com/opnsense/core/issues/7592
Title: Re: Override DHCP Valid Lifetime
Post by: Diggy on March 26, 2026, 04:09:36 PM
Quote from: hharry on March 26, 2026, 07:30:55 AMIt's been requested before here -> https://github.com/opnsense/core/issues/7592
Unfortunately that issue is "Closed as not planned".  Since I don't have a github login, I am officially making my request here for that feature.  LOL
Title: Re: Override DHCP Valid Lifetime
Post by: nero355 on March 26, 2026, 05:31:38 PM
Quote from: Diggy on March 26, 2026, 04:09:36 PMSince I don't have a github login
Then create one! LOL! :P
Title: Re: Override DHCP Valid Lifetime
Post by: sopex on March 26, 2026, 06:08:21 PM
Make all of them short.
Or use affinity, a very useful subset of instructions.
Or use the manual configuration to do exactly what you want.