1

I have DHCPD on OpenBSD 5.8 running and experiencing a weird issue.

I set the lease time as follows in /etc/dhcpd.conf:

max-lease-time 7200;
default-lease-time 7200;

This should be 2 hours.

When I check my dhcpd.leases file, I see this:

lease 172.24.186.224 {
  starts 5 2018/07/31 07:17:03 UTC;
  ends 5 2018/07/31 19:17:03 UTC;
  hardware ethernet b4:f6:1c:27:4f:a4;
  uid 01:b4:f6:1c:27:4f:a4;
  client-hostname "Apple";
}

This 12-hour lease time also checks out when doing a tcpdump and analyzing with Wireshark. (There are also some 24-hour lease times in the dhcpd.leases file which I can not explain either.)

I tried to set the max-lease-time and default-lease-time either in the "toplevel" config or for a specific subnet with no luck.

What is going on here?

  • Do you have another DHCP server in the same network? – Rui F Ribeiro Jul 31 '18 at 10:21
  • No. I took the tcpdump on the mentioned DHCP Server and I can see the offer with the wrong lease time is coming from this server. Edit: Maybe to add some information: I'm using IP-helpers, so the DHCP request is going through some subnets before arriving at the DHCP server. I don't know if this has anything to do with it. – Patrick Kohler Jul 31 '18 at 10:31
1

I just found the solution.

It seems to be a bug in this specific OpenBSD version:

http://openbsd-archive.7691.n7.nabble.com/dhcpd-on-5-8-AMD64-default-lease-time-and-max-lease-time-ignored-td285149.html

  • Excellent. Wait 2 days and mark this answer as correct. – Rui F Ribeiro Jul 31 '18 at 13:16
0

The new lease duration defaults, either local to a netblock, or global, only afect newly issued leases given after they are configured (and the dhcpd service restarted).

Old active leases take precedence to configuration changes (in some situations) and will be shown with the old defaults until they expire.

So only after 19:07 UTC today the lease of the MAC you are showing us will get the shorter lived lease you just configured.

If you want it to behave differently before the time is up, you have to delete that lease.

Note: If it a test system, you can either trunc the lease files to 0 bytes, or edit out the lines between "lease {" and "}" after stopping the dhcpd daemon.

  • Thanks for your answer. Unfortunately this does not solve my issue. I get the same lease time of 12 hours when connecting a computer that was not on the network before. I just noticed that a lot of lease entries are exact duplicates. That is not normal, is it? – Patrick Kohler Jul 31 '18 at 12:15
  • These are the last few entries of my lease file: pastebin.com/m5rR3Cxn – Patrick Kohler Jul 31 '18 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.