DHCP settings are ignored

I can't get OpenWrt to follow my DHCP settings. I have a single NIC x86 with managed switch. Switch is set to static IP.
LuCI overview shows no active DHCP leases. All clients have IP addresses that are outside the pool that is set. The two static DHCP leases that are set are ignored.
ipconfig on W10 client shows:

   Physical Address. . . . . . . . . : xx-xx-xx-xx-xx-xx
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::554b:d3e5:aa91:b698%17(Preferred)
   IPv4 Address. . . . . . . . . . . : 10.168.12.231(Preferred)  **This should be 10.168.12.10**
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Saturday, June 5, 2021 1:28:06 PM
   Lease Expires . . . . . . . . . . : Saturday, June 5, 2021 5:23:53 PM
   Default Gateway . . . . . . . . . : 10.168.12.1
   DHCP Server . . . . . . . . . . . : 10.168.12.2  **This is actually static IP of an AP, set on that AP**
   DHCPv6 IAID . . . . . . . . . . . : 111714649
   DHCPv6 Client DUID. . . . . . . . : xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx
   DNS Servers . . . . . . . . . . . : 10.168.12.1
                                       10.168.12.2
   NetBIOS over Tcpip. . . . . . . . : Enabled

/etc/config/dhcp

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

config dhcp 'lan'
	option interface 'lan'
	option leasetime '12h'
	option dhcpv6 'server'
	option ra 'server'
	option ra_management '1'
	option start '10'
	option limit '75'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

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

config host
	option mac 'xx:xx:xx:xx:xx:xx'
	option name 'Desktop1'
	option dns '1'
	option leasetime '12h'
	option ip '10.168.12.10'

config host
	option mac 'xx:xx:xx:xx:xx:xx'
	option leasetime '12h'
	option dns '1'
	option name 'Desktop2'
	option ip '10.168.12.20'

config domain
	option ip '10.168.12.1'
	option name 'Home.Lan'

config domain
	option name 'BSMT.AP'
	option ip '10.168.12.2'

config domain
	option name 'LR.AP'
	option ip '10.168.12.3'

config domain
	option name 'EXT.AP'
	option ip '10.168.12.4'

config domain
	option name 'Switch.Lan'
	option ip '10.168.12.250'

/etc/config/network


config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd78:15af:7f19::/48'

config interface 'WAN'
	option ifname 'eth0.10'
	option proto 'dhcp'
	option peerdns '0'
	list dns '1.0.0.1'
	list dns '1.1.1.1'
	option broadcast '1'

config interface 'lan'
	option ifname 'eth0.1'
	option type 'bridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '10.168.12.1'

I'll state the obvious. You cannot have 2 DHCP servers running in the same network, or you'll be experiencing issues like this.

1 Like

So, it turns out that switching to AP mode on TP-Link Archer C7 does not automatically disable DHCP. Once I disabled it, all seems to be good. It took you saying it, for me to check. Thank you!

1 Like

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

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