LEDE 17.x static dhcp lease not working

I use my own build with all configuration keeping the same between each build I compile. The static DHCP lease was working for LEDE-17.0.x branch but not working with LEDE master branch. Unfortunately, starting from about a month ago, the static DHCP lease failed on both branch.

Basically, the DHCP IP assigned does not follow what's configured. My DHCP pool starting from 100 ~ 150. All static lease assigned range from 50 ~ 90.

For some devices, the ip assigned are correct but for some devices, it's not.

Does anyone know what may cause this issue?

I have the same problem I think. I just installed latest release (Current Release - LEDE 17.01.2

) and when I enable static leases I loose access to the router.

Same issue here with LEDE 17.01.2. Driving me nuts cause my ip cams keep changing ips and causing nvr losing tract of them.

The problem may have been caused by a recent change in dnsmasq that has been used in LEDE master since late May and was backported to 17.01.2 (but was not in 17.01.0): http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commitdiff;h=5ce3e76fbf89e942e8c54ef3e3389facf0d9067a;hp=6ec5f5c4279c887ea4b464839e8cc3a2160599b3

That has now been fixed with http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=4bb68866a8aeb31db8100492bceae051e33be5d0
and backported to LEDE master with https://git.lede-project.org/?p=source.git;a=commitdiff;h=f33de8023228d7d6545ff12c4f2ef8febb486f37

Don't start ping-check of address in DHCP discover if there already
exists a lease for the address. It has been reported under some
circumstances android and netbooted windows devices can reply to
ICMP pings if they have a lease and thus block the allocation of
the IP address the device already has during boot.

Not sure if your problem is the same, but it may been at part of the problem.
So far the fix is only in LEDE master.

Meanwhile the fix is also present in the lede-17.01 branch (https://git.lede-project.org/?p=source.git;a=commit;h=91d41b630585df9832c9b070230d9e8660903bfc)

Got Dnsmasq-full 2.77-6 installed however the issue with assigning ip addresses to iOS devices still exist.

I'm on 17.01.4 and static leases don't work correctly.

I assigned a static lease (192.168.1.10) to my Raspberry Pi and if it tries to refresh the lease the address isn't available according to dhcpcd.

Nov 30 02:21:16 raspberrypi dhcpcd[539]: eth1: NAK: address not available from 192.168.1.1
Nov 30 02:21:16 raspberrypi dhcpcd[539]: eth1: message: address not available
Nov 30 02:21:16 raspberrypi dhcpcd[539]: eth1: deleting default route via 192.168.1.1
Nov 30 02:21:16 raspberrypi dhcpcd[539]: eth1: deleting route to 192.168.1.0/24
Nov 30 02:21:16 raspberrypi avahi-daemon[354]: Withdrawing address record for 192.168.1.10 on eth1.
Nov 30 02:21:16 raspberrypi avahi-daemon[354]: Leaving mDNS multicast group on interface eth1.IPv4 with address 192.168.1.10.
Nov 30 02:21:16 raspberrypi avahi-daemon[354]: Interface eth1.IPv4 no longer relevant for mDNS.
Nov 30 02:21:16 raspberrypi dhcpcd[539]: eth1: soliciting a DHCP lease
Nov 30 02:21:20 raspberrypi dhcpcd[539]: eth1: offered 192.168.1.203 from 192.168.1.1
Nov 30 02:21:20 raspberrypi dhcpcd[539]: eth1: probing address 192.168.1.203/24
Nov 30 02:21:25 raspberrypi dhcpcd[539]: eth1: leased 192.168.1.203 for 43200 seconds
Nov 30 02:21:25 raspberrypi avahi-daemon[354]: Joining mDNS multicast group on interface eth1.IPv4 with address 192.168.1.203.
Nov 30 02:21:25 raspberrypi avahi-daemon[354]: New relevant interface eth1.IPv4 for mDNS.
Nov 30 02:21:25 raspberrypi dhcpcd[539]: eth1: adding route to 192.168.1.0/24
Nov 30 02:21:25 raspberrypi avahi-daemon[354]: Registering new address record for 192.168.1.203 on eth1.IPv4.
Nov 30 02:21:25 raspberrypi dhcpcd[539]: eth1: adding default route via 192.168.1.1

Well, it works for me, and it works for many others... perhaps you could post your config files, and the server logs.

I checked logread | less but there was no entry at that time.

I added the static lease via LuCI and /etc/config/dhcp contains the following:

config host
		option name 'raspberrypi'
		option dns '1'
		option mac '[censored]'
		option ip '192.168.1.10'

Try setting the lease time to infinite.

1 Like

Use "logread -f" to see the messages as they arrive, and then restart the client.
Also, add a "log-dhcp" line at the end of "/etc/dnsmasq.conf" to see more messages.