A guest DHCP instance starts with an empty lease file and fails after handing out addresses. If the error names dhcp.leases, keep the file. A timestamp, MAC and IP on line one look like a valid lease being read as configuration.
Which instance reads the file?
Run these commands on OpenWrt. Match the instance to its actual -C file if the generated path differs. Compare dhcp-leasefile with every conf-dir, including filename filters. A matching lease file will be parsed as options. For No such file or directory, check the parent at boot. The 25.12.6 script can create the file when the parent exists.
ubus call service list '{"name":"dnsmasq"}'
grep -E '^(conf-dir|dhcp-leasefile)=' /var/etc/dnsmasq.conf.*
Test the parser without restarting DHCP
Use one SSH session. Stop if creating the temporary directory fails. The first syntax check should fail on the sample lease. The second moves it outside the included directory. Remove only the sample and empty test directories afterwards.
dir=$(mktemp -d) && cd "$dir" && mkdir conf.d
echo '0 02:00:00:00:00:01 192.0.2.10 demo *' > conf.d/dhcp.leases
dnsmasq --test -C /dev/null --conf-dir="$dir/conf.d"
mv conf.d/dhcp.leases ./guest.leases
dnsmasq --test -C /dev/null --conf-dir="$dir/conf.d" --dhcp-leasefile="$dir/guest.leases"

Real SSH session on OpenWrt 25.12.6 in QEMU with dnsmasq 2.93. Syntax now passes. Write access still needs a live renewal.
Give each instance a separate path
Back up /etc/config/dhcp. In the guest config dnsmasq section set leasefile to /tmp/dhcp.guest.leases. Give other instances distinct files. During maintenance stop the affected service before moving its own leases. Keep copies outside every included directory. Never split a shared lease file blindly. Start the service and renew a guest device. Check the new record, restart once more and test renewal and DNS again. For permission errors check the writable jail mount. Roll back to the last working configuration and matching leases if needed.
Comments