<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>Hi,<br></div><div><br></div><div>Just to add to the comedy, and set folks' minds at ease about dnsmasq...<br></div><div><br></div><div>When I started running dhcpdump to do more diagnostics (when isc-dhcp-server stared responding with 5 minute lease times) I discovered that the nmap command I was using to test was specifically requesting a 1 second lease, so dnsmasq was replying with the default minimum lease time of 2 minutes... oops.<br></div><div><br></div><div>The issue I had on Windows hosts was a client weirdness, it was trying to renew a lease issued by a temporary DHCP server I had running on an old LTE router while I was upgrading my Raspbian box. Once I did a ipconfig /release followed by ipconfig /renew instead of just ipconfig /renew everything went back to normal. You would think the Windows IP stack would send out a broadcast for a new address if it can't see the last DHCP server it contacted, but oh well.<br></div><div><br></div><div>I expect I'll have to just forget the wireless network and reconnect with my Android devices to get those to start getting leases properly again.<br></div><div><br></div><br><div data-zbluepencil-ignore="true" style="" class="zmail_extra"><br><div id="Zm-_Id_-Sgn1">---- On Thu, 28 Nov 2019 23:09:15 +0200 <b>Geert Stappers <stappers@stappers.nl></b> wrote ----<br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); padding-left: 6px; margin: 0px 0px 0px 5px;"><div>On Thu, Nov 28, 2019 at 09:49:43PM +0200, Johan Kruger wrote: <br>> Hi, <br>> <br>> I have a fairly simple DHCP setup on a Raspbian box, using dnsmasq <br>> 2.80. The relavant options in /etc/dnsmasq.conf are (yes, my home LAN <br>> is 10.168.8.0/24): <br>> <br>> <br>> <br>> dhcp-range=10.168.8.10,10.168.8.200 # Also tried with 12h on the end, no difference <br>> dhcp-authoritative <br>> log-dhcp <br>> <br>> <br>> I'm testing by running "dnsmasq -d" in a shell, so I can see what's going on. <br>> <br>> <br>> When dnsmasq gets a DHCP request (I'm using "nmap --script <br>> broadcast-dhcp-discover" on another box to test), I see the following: <br>> <br>> <br>> <br>> dnsmasq-dhcp: 811185697 broadcast response <br>> dnsmasq-dhcp: 811185697 sent size:  1 option: 53 message-type  2 <br>> dnsmasq-dhcp: 811185697 sent size:  4 option: 54 server-identifier  10.168.8.254 <br>> dnsmasq-dhcp: 811185697 sent size:  4 option: 51 lease-time  2m <br>> dnsmasq-dhcp: 811185697 sent size:  4 option: 58 T1  1m <br>> dnsmasq-dhcp: 811185697 sent size:  4 option: 59 T2  1m45s <br>> dnsmasq-dhcp: 811185697 sent size:  4 option:  1 netmask  255.255.255.0 <br>> dnsmasq-dhcp: 811185697 sent size:  4 option: 28 broadcast  10.168.8.255 <br>> dnsmasq-dhcp: 811185697 sent size:  4 option:  3 router  10.168.8.254 <br>> dnsmasq-dhcp: 811185697 sent size:  4 option:  6 dns-server  10.168.8.254 <br>> dnsmasq-dhcp: 811185697 sent size: 16 option: 15 domain-name  myhome <br>> <br>> <br>> Notice the lease-time, T1 and T2 responses... 2 minutes??? Default <br>> should be 1 hour, and I get the same 2m if I specify 12h in the <br>> dhcp-range line. <br>> <br>> <br>> <br>> I then added the following to the conf file: <br>> <br>> <br>> dhcp-option=51,12h <br>> dhcp-option=58,12h # DHCP Renewal (T1) Time <br>> dhcp-option=59,12h # DHCP Rebinding (T2) Time <br>> <br>> <br>> Then the response looked like this: <br>> <br>> <br>> dnsmasq-dhcp: 1994188113 broadcast response <br>> dnsmasq-dhcp: 1994188113 sent size:  1 option: 53 message-type  2 <br>> dnsmasq-dhcp: 1994188113 sent size:  4 option: 54 server-identifier  10.168.8.254 <br>> dnsmasq-dhcp: 1994188113 sent size:  4 option: 51 lease-time  2m <br>> dnsmasq-dhcp: 1994188113 sent size:  4 option: 58 T1  1m <br>> dnsmasq-dhcp: 1994188113 sent size:  4 option: 59 T2  1m45s <br>> dnsmasq-dhcp: 1994188113 sent size:  4 option:  1 netmask  255.255.255.0 <br>> dnsmasq-dhcp: 1994188113 sent size:  4 option: 28 broadcast  10.168.8.255 <br>> dnsmasq-dhcp: 1994188113 sent size:  4 option:  3 router  10.168.8.254 <br>> dnsmasq-dhcp: 1994188113 sent size:  4 option:  6 dns-server  10.168.8.254 <br>> dnsmasq-dhcp: 1994188113 sent size: 16 option: 15 domain-name  myhome <br>> dnsmasq-dhcp: 1994188113 sent size:  4 option: 51 lease-time  12h <br>> <br>> <br>> Two lease-time responses, at least the correct 12h one is second so <br>> the client uses that, but notice that T1 and T2 are still wrong. <br>> <br>> <br>> <br>> The upshot is that most DHCP clients (Android and Windows anyway) <br>> just reject the response. <br>> <br>> <br>> <br>> For now, I guess I'll have to install isc-dhcp-server, since 2.80 is <br>> the only version of dnsmasq available for Raspdian 10 (buster). Bit <br>> of overkill for a little home LAN only running a couple of devices, <br>> but there we have it. <br> <br>Whatever works for you and thanks for the joke <br> <br> <br> <br>_______________________________________________ <br>Dnsmasq-discuss mailing list <br><a target="_blank" href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.thekelleys.org.uk</a> <br><a target="_blank" href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a> <br></div></blockquote></div><div><br></div></div><br></body></html>