Dnsmasq: having unknown hosts on a different network than the known ones

Hi all,
I’m looking for a way to configure dnsmasq but i’m unsure if it is even possible:

  • all known hosts are declare with mac/ip bindidng on a certain network (let say 10.0.1.0/24)
  • all undeclared machine would get a dynamic ip on a different network (let say 10.0.2.0/24)

Is it possible?

And the answer is yes!
To do it you need first to add an extra ip to your interface for instance:
/etc/config/network:

[...]
config interface 'lan'
    option device 'eth1'
    option proto 'static'
    option ipaddr '10.0.1.254'
    option netmask '255.255.255.0'
    option ipv6 '0'
    option delegate '0'

config interface 'lantrash'
    option device 'eth1'
    option proto 'static'
    option ipaddr '10.0.2.254'
    option netmask '255.255.255.0'
    option ipv6 '0'
    option delegate '0'
[...]

Then you can use the extra ip through the fake interface added.
the tags 'know' and '!know' tells dnsmasq to which interface/networks belongs the dhcp client depending on whether or not it has been declared.

/etc/config/dnsmasq:

config dhcp 'lan'
	option	interface	'pro'
	option	dhcpv4		'server'
	option	dhcpv6		'disable'
	option	dynamicdhcp	0
	list	        dhcp_option	'option:router,10.0.1.254'
	list	        dhcp_option     'option:ntp-server,10.0.1.254'
	list	        dhcp_option	'option:dns-server,10.0.1.254'	
	list	        tag		        'known'

config dhcp 'lantrash'
	option	interface	'protrash'
	option start '100'
	option limit '150'
	option leasetime '12h'
	list	tag		'!known'

I got help from the two following...