[Dnsmasq-discuss] Leases don't expire anymore

Simon Kelley simon at thekelleys.org.uk
Mon Jan 14 11:09:41 GMT 2013


On 14/01/13 10:42, Hans-Joachim Baader wrote:
> Hi,
> 
> since 2.63 at least the leases on some of our servers don't expire anymore. The servers
> are quite busy with up to 400 different clients per day and they have only 254 leases.
> However they are set to expire after one hour. While we had no problems with 2.42,
> now we often get the message
> 
> DHCPDISCOVER(eth0) xx:xx:xx:41:e5:09 no address available
> 
> and nothing works until we delete dnsmasq.leases and restart dnsmasq. But there
> are really still plenty addresses available:dnsmasq.leases contains a lot of lines
> starting with 0 and only 20 that are not expired. So this must be a regression in dnsmasq.
> The problem always seems to start when the number of lines in dnsmasq.leases
> reaches 254.
> 
> The config is (some addresses changed):
> 
> 
> pid-file=/var/run/dnsmasq/dnsmasq.pid
> no-poll
> dhcp-no-override
> domain=dom.local
> 
> dhcp-range=net1,172.16.81.1,172.16.81.254,1h
> dhcp-range=net2,192.168.1.101,192.168.1.120,1h
> 
> dhcp-option=46,1           # netbios node type
> dhcp-option=net1,option:router,172.16.11.254
> dhcp-option=net2,option:router,192.168.1.1
> dhcp-option=6,172.16.1.1
> dhcp-option=net1,1,255.255.0.0
> dhcp-option=net2,1,255.255.255.0
> 
> dhcp-option=tag:!bootp,43,09:0f:00:03:0c:4e:65:74:77:6f:72:6b:20:62:6f:6f:74:0a:05:00:4d:45:4e:55:06:01:02:08:03:00:03:00:47:04:00:03:00:00:43:01:41:ff
> 
> dhcp-boot=dummy.0,server051,172.16.1.61
> bootp-dynamic
^^^^^^^^^^^^^^^^

This is your problem. Every time something does BOOTP, it is allocated
an address and keeps it forever. BOOTP has no concept of a lease, and no
way to reclaim addresses.



If you have a small fixed number of clients doing BOOTP, turn off
bootp-dynamic, and use dhcp-host to nail them to fixed addresses by MAC
address. If you're continually using BOOTP on new clients, then best you
can do is use a separate address range for BOOTP clients (to aviod  DHCP
 breaking too) and clear out the old DHCP addresses when you get problems.

Cheers,

Simon.


> 
> dhcp-lease-max=254
> dhcp-authoritative
> 
> 
> 




More information about the Dnsmasq-discuss mailing list