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
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 …
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 …
And now it is not … 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.
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.