[Dnsmasq-discuss] default lease time for dhcp-host entries ?

Maule Mark mark_maule at yahoo.com
Mon Dec 16 19:36:45 GMT 2013


I'm seeing an unexptected (to me) behavior when using a dnsmasq hostsfile and dhcp.  To start, my interface (pmi_if) is configured with a lease time of 1h (the default), and I have a blank hostsfile.

dhcp-leasefile=/var/lib/axiom/dnsmasq_pmi.leases
dhcp-hostsfile=/var/lib/axiom/dnsmasq_pmi_hostsfile
dhcp-range=172.30.80.0,static,255.255.255.0
dhcp-range=172.30.80.200,172.30.80.240,255.255.255.0
dhcp-lease-max=255
dhcp-option=option:dns-server,172.30.80.1
dhcp-option=option:router,172.30.80.1
dhcp-option=option:ntp-server,172.30.80.1,172.30.80.2,172.30.80.3
dhcp-option=option:default-ttl,50
dhcp-option=option:all-subnets-local,1
dhcp-script=/var/lib/axiom/dhcp-script-pmi.sh
dhcp-boot=/pds/pxe/pxelinux.0,172.30.80.1

Clients boot and are assigned dhcp addresses as expected.  We have a program in our software stack that looks for heartbeat messages on this pmi_if, and when detected, constructs a hostsfile entry for the client that looks like this:

[root at pilot2 axiom]# cat dnsmasq_pmi_hostsfile
00:21:28:A1:F3:F2,00:21:28:A1:F3:F3,,WN5080020001592690,172.30.80.128
00:21:28:A1:CA:3A,00:21:28:A1:CA:3B,,WN5080020001592691,172.30.80.129

The clients are running udhcpc from busybox.

Everything works as expected until the clients get toward the end of their 1h lease period at which point the clients start sending DHCPREQUEST requests.  It seems at this point, that the leases granted are now 120s.  Here's some syslog output showing the first DHCPREQUEST being sent about 55 minutes into the 1h initial lease.  Why did dnsmasq return a lease time of 12s in this case?

2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 DHCPREQUEST(pmi_if) 172.30.80.129 00:21:28:a1:ca:3a
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 tags: known, pmi_if
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 DHCPACK(pmi_if) 172.30.80.129 00:21:28:a1:ca:3a WN5080020001592691
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 requested options: 1:netmask, 3:router, 6:dns-server, 12:hostname,
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 requested options: 15:domain-name, 28:broadcast, 42:ntp-server
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 bootfile name: /pds/pxe/pxelinux.0
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 server name: 172.30.80.1
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 next server: 172.30.80.3
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  1 option: 53 message-type  5
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  4 option: 54 server-identifier  172.30.80.3
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  4 option: 51 lease-time  2m
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  4 option: 58 T1  56s
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  4 option: 59 T2  1m41s
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  4 option:  1 netmask  255.255.255.0
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  4 option: 28 broadcast  172.30.80.255
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  5 option: 15 domain-name  axiom
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size: 18 option: 12 hostname  WN5080020001592691
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size: 20 option:209   70:78:65:6c:69:6e:75:78:2e:63:66:67:2f:64...
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  4 option:208   f1:00:74:7e
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size: 12 option: 42 ntp-server  172.30.80.1, 172.30.80.2, 172.30.80.3
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  4 option:  3 router  172.30.80.1
2013-12-16 19:33:42.253+00:00 pilot2 dnsmasq-dhcp[23916]: 208328817 sent size:  4 option:  6 dns-server  172.30.80.1


Is there a default lease time of 120s for client requests whose addresses which match a hoststfile entry?

thanks
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20131216/ac768783/attachment.html>


More information about the Dnsmasq-discuss mailing list