← Back to context

Comment by ThePowerOfFuet

2 days ago

> I had changed the DHCP lease time on my router from the default to a really low value. I believe I had set it to 15 minutes.

What were you hoping to achieve by doing that?

I like low lease times. DHCP server knows what's really on the network, and if something requests lots and lots of the pool you'll be fine in 15-30 minutes.

If things are set to a really long time, >=12 hours, you find out the next day when everything is broken (or you get alerts in the middle of the night). If you set them to a randomized 15-90m span, you get things breaking immediately when you screw up the dhcp server.

  • Hah. Your answer just has more questions. What on earth is requesting so many DHCP leases?

    • You've never accidentally spun something up that consumes all the leases?

      It's just been a couple of times, but I've definitely done it (e.g. bridged a couple of networks that shouldn't have been).

      But mostly, it's the other two things: it provides me with a list of hosts active now, and if the DHCP server is subtly broken I get a sentinel signal of something being wrong earlier (and it tends to be a partial instead of complete failure).

      One more bonus: if I move something to a static lease, out of the pool, it'll renumber in a reasonable time and I don't need to go kick link state to get it to request again.

      Things like really big caches and really long lease times: They're good for average performance, and they can let you ride out small problems. The flip side is that they tend to mask problems and to create really big demand transients at times. The trick is always to find a good middle ground.

      1 reply →

    • Modern devices will randomize MAC unless told not to when connecting / reconnecting to a wifi/Ethernet network.

      When on a pretty standard /24 network subnet, if there are more than a few dozen devices coming and going, the lease table can fill up until older lease reservations expire.

I was trying to determine if a lease expired, if my router would immediately try to lease that same IP out to another machine on the network. It felt like it cached an expired lease mapping and would try to keep that old IP un-leased in case the original machine to which it was mapped came back online. I was just trying to better understand the behaviour.

  • Did you want certain IPs to be fixed to certain devices or do you prefer they be randomly allocated?

    • Neither really, though my ISP's router would allow me to assign IPs by MAC address so they're effectively reserved to a device. The router's web UI displayed a list of devices. I wanted to see if devices would start dropping off this list as soon as the DHCP lease time expired. When they did drop off this list, I had thought they reappeared with the same IP without me explicitly using the reservation functionality. So how was this happening? I figured the web UI might not be showing the full picture of all the data about devices; that the router held records of formerly connected devices beyond the DHCP lease time for some unknown reason.