DHCP different range for static IPs

Hello guys!
Is there a way to configure OpenWrt DHCP server to assign IP addresses for static leases from one IP subnet, for example 172.16.1.0, and for all dynamic (not configured) from another IP subnet, for example 172.17.1.0?

Router has both 172.16.1.1 and 172.17.1.1 IP addresses configured for the LAN bridge. It's all the same wired network, but with the different IP subnets.

You can configure a lease for each static device.

See: https://openwrt.org/docs/guide-user/base-system/dhcp#static_leases

You will likely have to specify the DHCP option for it's gateway, that is DHCP Option No. 2.

Yes, I have static leases already, but I want to move dynamic leases to another subnet, which doesn't seems to be working with a straight forward configuration.

With this LAN configuration:

config interface 'lan'
	option type 'bridge'
	option ifname 'eth1.1'
	option proto 'static'
	option netmask '255.255.255.0'
	list ipaddr '172.16.1.1'
	list ipaddr '172.17.1.1'

Static lease working:

config host
	option dns '1'
	option name 'Admin'
	option mac 'e0:cb:4e:f1:f1:f1'
	option ip '172.16.1.11'

Static lease not working:

config host
	option dns '1'
	option name 'Admin'
	option mac 'e0:cb:4e:f1:f1:f1'
	option ip '172.17.1.11'

Looks like list of IP addresses is not supported by UCI for dnsmasq (dnsmasq itself has a full support of IP aliases though)

Yep, IP aliases are not supported in OpenWrt for dnsmasq for now, we need to use virtual interfaces:

config interface 'lan'
	option type 'bridge'
	option ifname 'eth1.1'
	option proto 'static'
	option ipaddr '172.16.1.1'
	option netmask '255.255.255.0'

config interface 'lan2'
	option type 'bridge'
	option ifname 'eth1.1'
	option proto 'static'
	option ipaddr '172.17.1.1'
	option netmask '255.255.255.0'

config dhcp 'lan'
	option interface 'lan'
	option leasetime '2h'
	option netmask '255.255.255.0'
	option force '1'
	option start '240'
	option limit '1'
	option dynamicdhcp '0'

config dhcp 'lan2'
	option interface 'lan2'
	option leasetime '2h'
	option netmask '255.255.255.0'
	option force '1'
	option start '10'
	option limit '10'
	option dynamicdhcp '1'

This way UCI generates a proper config for dnsmasq and leases for both pools are working.

You can replace this with a simple option ifname @lan to avoid the bridge duplication.

Thanks. I thought this configuration will also confuse UCI for dnsmasq, but looks like it's working properly.