Static DHCP stopped working

Hi everyone -

It has been a while since I have posted, mostly because things have been working very well. However, recently my DHCP server has stopped giving out static lease … I started noticiing this as some of my devices started going offline as they were unable to get an ip address as my dyncamic IP lease pool is relatively small. Anyhow, I looked into the OpenWRT (running on an intel Mac Mini for over a year) and found that Luci is no longer showing DHCP option (Network→ DHCP) and the Status page is not showing any DHCP activity. I ran the Logread -f after doing a restart of the dnsmasq and found that DHCP is giving out IP but only in the small dynamic pool. Static leases are being ignored. Also, in Luci, Network→Interfaces→lan→DHCP Server says No DHCP Server configured for the Interface and if I click the Setup DHCP Server the following error message pops up

RPC call to uci/add failed with ubus code 9: Unspecified error at ClassConstructor.handleCallReply (http://192.168.9.1/luci-static/resources/rpc.js?v=git-25.222.75657-7ce34fe:15:3)”

I also ran the following command in a terminal:

uci show dhcp >/dev/null

and got the following output

uci: Parse error (EOF with unterminated ') at line 458, byte 2477

I looked through my /etc/config/dhcp file but couldn’t find anything obvious ….

Anything else I am missing?

Here are he OpenWRT version specifics:

Model
Architecture
Target Platform
Firmware Version

TIA

that's very generic ...

Crap .. copy and paste error … here you go again:

Model: Apple Mac Mini 7,1

Archtecture: Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz

Target Platform: x86/64

Firmware version: OpenWrt 23.05.3 r23809-234f1a2efa / LuCI openwrt-23

.05 branch git-25.222.75657-7ce34fe

Kernel version: 5.15.150

1 Like

this version has been EOLed, start by upgrading.

If your "Static IPs" are not within the range of that "small dynamic pool", your issue is normal and expected behavior.

Alter the range or statically address the host.

But I think you're experiencing mutuple issues.

That happens when you upgrade individual packages

Install auc to get them all in sync on v23, then upgrade to v24 ( -V 24.10)

1 Like

Could you share it here, please?

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

config dnsmasq 'lan_dns'
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'mydomain'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases.lan'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option localservice '0'
	list interface 'lan'
	option sequential_ip '1'

config dhcp 'lan'
	option instance 'lan_dns'
	option interface 'lan'
	option start '230'
	option limit '20'
	option leasetime '12h'
	list dhcp_option '6, 192.168.9.5'

config dnsmasq 'vlan_100_dns'
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/vlan_100/'
	option domain 'home'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases.vlan_100'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	list interface 'vlan_100'
	list notinterface 'loopback'
	option localservice '0'
	option sequential_ip '1'

config dhcp 'vlan_100'
	option instance 'vlan_100_dns'
	option interface 'vlan_100'
	option start '200'
	option limit '50'
	option leasetime '1h'
	list dhcp_option '6, 192.168.9.5'

config dnsmasq 'vlan_500_dns'
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/vlan_500/'
	option domain 'guest'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases.vlan_500'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	list interface 'vlan_500'
	list notinterface 'loopback'
	option localservice '0'
	option sequential_ip '1'

config dhcp 'vlan_500'
	option instance 'vlan_500_dns'
	option interface 'vlan_500'
	option start '100'
	option limit '150'
	option leasetime '1h'
	list dhcp_option '6,192.168.9.5'

config dnsmasq 'vlan_666_dns'
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/vlan_666/'
	option domain 'iot'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases.vlan_666'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	list interface 'vlan_666'
	list notinterface 'loopback'
	option localservice '0'
	option sequential_ip '1'

config dhcp 'vlan_666'
	option instance 'vlan_666_dns'
	option interface 'vlan_666'
	option start '150'
	option limit '100'
	option leasetime '12h'

config host
	option name 'moonbase-3'
	option ip '10.10.10.15'
	option mac 'redacted'

config host
	option name 'MyQ'
	option ip '10.10.10.20'
	option mac 'redacted'

config host
	option name 'momo'
	option ip '10.10.10.25'
	option mac 'redacted'

config host
	option name 'tsunami'
	option ip '10.10.10.30'
	option mac 'redacted'

config host
	option name 'sw-family-room'
	option mac 'redacted'
	option ip '192.168.9.15'

config host
	option name 'sw-office'
	option mac 'redacted'
	option ip '192.168.9.16'

config host
	option name 'sw-master-bedroom'
	option mac 'redacted'
	option ip '192.168.9.17'

config host
	option name 'sw-office-2'
	option mac 'redacted'
	option ip '192.168.9.18'

config host
	option name 'moca-family-room'
	option mac 'redacted'
	option ip '192.168.9.20'

config host
	option name 'moca-office'
	option mac 'redacted'
	option ip '192.168.9.21'

config host
	option name 'moca-master-bedroom'
	option ip '192.168.9.22'
	list mac 'redacted'




My network is VLAN segmented as follows:

(VLAN_100): 192.168.100.x (contains HomeKit enabled devices, media player, and family iOS devices)

(VLAN_500): 172.31.31.x - Guest Network (only allowed Internet access)

(VLAN_666): 10.10.10.x - IoT devices - only allowed access to the Internet

LAN: 192.168.9.x - Home Lab / Secure - servers, switches and APs

I statically map all my server and iOT devices and allow for a very small DHCP pool for any device connectivity specially in my Home Lab, iOT and Home networks … Guest VLAN has a small DHCP pool and mostly for kid’s friends who visit us and need to access their digital lives … :slight_smile:

This all was working perfectly ….

Haven’t use auc … will look into it .. thanks for the pointer.

It’s on the roadmap … seems I may have to do it sooner.

When a new device was added to my network, it would get an IP from the DHCP pool and then I would statically map it by adding following in the /etc/config/dhcp file

Example
config host
	option name 'ubuntu22'
	option mac 'some mac address'
	option ip '192.168.9.21'

And then after the reboot, the device would get the statically mapped IP address from the DHCP server … it worked … beautifully …

That is correct. If you add via luci it reloads dnsmasq with new reservation and the address is fixed after.

And now it is not :wink: … my statically mapped devices are getting IPs from the DHCP pool … which is messing up automation and making them go offline due to insufficient IP addresses in the pool.

This error literally means that:

  • /etc/config/dhcp should contain 458 lines (which is different from what you posted)
  • somewhere in the file there is a missing single quote (')
1 Like

What did you do to get that? Did you add something in a GUI?

One of the config files in /etc/config has an error on line 458. You forgot to close a which surround values. Not necessarily dhcp. uci show x parses all configs and displays those that match dhcp, I think.

option name 'printer'' << found the culprit …

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.