I want to set up dnsmasq to serve DHCP for a subnet to which the router itself is not directly connected to (and so another router will relay the request with option 82 set). Is there any easy way of doing this within the existing set of options available for use in /etc/config/dhcp - or do I just have to edit /etc/dnsmasq.conf?
The main issue seems to be that there's no way of specifying a range outside one that's tied to a specific interface -- and so the subsequent directives also have to go in /etc/dnsmasq.conf
Did you try to add an extra dhcp pool/scope on the same interface by adding a new
config dhcp section?
config dhcp 'external-lan'
option interface 'lan'
option dhcpv4 'server'
option dhcpv6 'server'
option start '150'
option limit '49'
uci doesn't allow to specify a start/end IP address.
Only start and offset values
But in the wiki there is the following info:
Assigning DHCP pool to a subnet in a large network
In DHCP pool limit setting, the start and limit values do not refer to the “last digit”, they're relative offsets to the network address.
the network address of 10.0.0.1 / 255.0.0.0 is 10.0.0.0
the 10.22.0.1 start address is 22 x /16 subnets away: (2^16) * 22 = 1441792
10.0.0.0 + 1441792 + 1 = 10.22.0.1 → start = 1441793
10.22.0.254 - 10.22.0.1 = 253 → limit = 253
config dhcp lan
option interface lan
option start 1441793
option limit 253
I haven't tried this, but maybe it does work.
But seems quite limited...
Maybe there is some other way to get this working (without using /etc/dnsmasq.conf) ?