Active Leases list lost on reboot

I have a static IP for my computer.
It shows up in the DHCP for Active Leases when it first requests an IP.
If I reboot the router my computer no longer shows up as an Active Lease but it still has the IP from the existing lease?
Should rebooting the router remember Active Leases?
Is it because I made it static?
Does mean nlbw will no longer track usage from this computer?

No, active leases are stored in RAM, so this gets reset when the router is rebooted.

Did you make the IP static on the computer itself, or via DHCP reservations? The former certainly will never show up in the DHCP leases since there is never a DHCP lease request from a host that is set with a static IP. On the latter, I don't recall if static leases will show up in the normal DHCP leases table, but it is important to consider the lease time.

The DHCP leases table will only update when there is a DHCP request. This will happen anytime a device is rebooted or its network connection is established/re-established, or a time based renewal request that is 50%, 85%, or 100% of the lease time.

3 Likes

Reserved Addresses on the router.
Shouldn't Active Leases be stored on disk?

Only if you have a device with a durable storage medium (say, x86 with an SSD). On flash-based devices, this would vastly accelerate degradation of the storage.

Yup, they're there. I see about a dozen in /tmp/dchp.leases at any given time, mixed in with the dynamic ones.

2 Likes

A summary:

  1. All dhcp leases (both dynamic and static leases) are kept in /tmp/dhcp.leases as a result of a dhcp request.
  2. /tmp is a ram-disk and gets reinitialised on reboot.
  3. A static lease is a lease that always gives the same ip address as a result of a dhcp request.
  4. A dynamic lease is allocated according to availability, it might be the same as last time, but might not, depending on numerous factors.
  5. Static leases are configured in /etc/config/dhcp This is in flash memory and does survive a reboot.
  6. A static IP (not a static lease) is configured on the user device and dhcp knows nothing about it.
3 Likes