DHCP (IPv4) Leases list issue



  • The DHCP Leases list shows start and end date/time info for all of the static DHCP entries, even if that date/time is in the past. See my screenshot for example.




  • Are all the "past" leases the Static ones?
    Can't tell what time/date you took the screen shot.



  • It was taken a couple of minutes before the post was made, EST (GMT -5), with times showing in local time. The last three in my screenshot are static entries, all showing the same date/time, all with end times over 5 hours past (knowing that static entries don't really expire).

    Does 2.2.6 handle static DHCP entries the same way in this list? I thought it didn't show a date/time for them.



  • 2.2.6 definitely shows "n/a" for Lease start and end times.
    Not sure what the intent with 2.3 is…..



  • Mine also show times that are "out of date" for the static leases on occasion.  In my opinion, I'd like to see these times reflect the actual DHCP lease times (as the device getting the lease would see).  I have to troubleshoot DHCP issues from time to time and I'd like pfSense to show the lease times consistent which what the device thinks they are.  Sometimes it's nice to know when the lease was issued or when the device thinks the lease will "expire" and thus when the device might attempt to renew.  Just my 2 cents…



  • dhcpd doesn't record leases for static mappings, as they aren't leases in the traditional sense. They'll never be handed out to anything else, and never expire. So it's not possible to display the lease time for static mappings.

    I'm guessing those who have a date listed for static mappings, those hosts obtained a normal lease before they had a static mapping configured, and it hasn't aged out of the leases file yet. That page in 2.2.x and prior just set "n/a" for static mappings. Restored that behavior.
    https://redmine.pfsense.org/issues/5942



  • Thanks Chris! Actually, it didn't ever seem to age out… in fact, the next day after my screenshots, the date and time had changed from the previous day, and again, all of the static leases had the same date and time.

    Glad to see the n/a functionality restored for those static leases! Not sure if that also needs to be applied to DHCPv6 leases list or not... I don't have any static DHCPv6 leases.



  • cmb, could you comment more on these leases not being traditional leases?  It was my understanding that they really are "traditional" leases (from the point of view of the device getting the lease).  The device will have a time the lease was obtained and they seem to have an expire time consistent with the normal dynamic leases.  In other words, the device thinks it is a dynamic lease for all practical purposes.  In my mind, they are only static in that the DHCP server will always issue the assigned IP to the assigned MAC (no exceptions).  If all this is true, I personally feel like showing the leases times as the client will seem them to be beneficial.  I recently had to troubleshoot some DHCP issues that were static leases (for a non-pfSense situation) and it became critical to know the lease/expire times as the client was seeing them to understand the behavior properly.



  • @virgiliomi:

    Thanks Chris! Actually, it didn't ever seem to age out… in fact, the next day after my screenshots, the date and time had changed from the previous day, and again, all of the static leases had the same date and time.

    In that case it's probably pulling the last date from the leases file I guess, I didn't trace through the code to see what it'd end up with there otherwise.

    @virgiliomi:

    Not sure if that also needs to be applied to DHCPv6 leases list or not… I don't have any static DHCPv6 leases.

    I checked that, it still had the same previous behavior so is fine.

    @AsgardianFW:

    cmb, could you comment more on these leases not being traditional leases?

    Meaning dhcpd never puts them into the leases file. It only puts IPs assigned dynamically from pools into dhcpd.leases.



  • Thanks for the info.  Does the dhcp server record the static lease info anywhere?  I still think seeing the lease times for static leases is extremely helpful.  I don't need that info often, but when I do, it would be nice to know what it is.  Maybe, I'm just being too anal about DHCP leases.  :-\



  • It's not recorded anywhere outside the logs. That just records that it handed it out, no lifetime or anything. You don't get that type of info off DHCP static mappings in any widely-used DHCP server software.