I have a dnsmasq server which I am using to serve DHCP and cache DNS. It is running on a Raspberry Pi. The range of addresses available in the pool is too small for the number of devices that regularly enter and leave the network, so I am trying to get it to serve addresses from a different subnet, but using the same gateway. but it is only allocating from one range.
There is lots of advice on how to allocate to different subnets based on which NIC is servicing the request or on mac address, but nothing on combining subnets in this way from a single NIC and having them use a single gateway. What is there suggests that the setup below should just work, but it just doesn't.
The man page is no help either.
Situation:
router/gateway: 192.168.1.1
DNS/DHCP: 192.168.1.2
reserved: 192.168.1.3-150
ON DNS Server: /etc/network/interfaces
auto eth0
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.2
gateway 192.168.1.1
netmask 255.255.0.0
network 192.168.0.0
broadcast 192.168.1.255
On DNS Server /etc/dnsmasq.conf
#/etc/dnsmasq.conf
domain-needed
bogus-priv
domain=local.net
expand-hosts
local=/local.net/
listen-address=192.168.1.2
bind-interfaces
cache-size=1000
dhcp-authoritative
dhcp-leasefile=/var/lib/dhcp/dhcpd.leases
dhcp-range=eth0,192.168.1.150,192.168.1.250,255.255.0.0,24h
dhcp-range=eth0,192.168.2.10,192.168.2.250,255.255.0.0,24h
dhcp-range=eth0,192.168.3.10,192.168.3.250,255.255.0.0,24h
dhcp-range=eth0,192.168.4.10,192.168.4.250,255.255.0.0,24h
dhcp-option=3,192.168.1.1
dhcp-option=6,192.168.1.2
dhcp-option=42,192.168.1.2
server=8.8.8.8
server=8.8.4.4
server=208.67.220.220
The solution above tries to set up 4 vlans:
dhcp-range=eth0,192.168.1.150,192.168.1.250,255.255.0.0,24h
dhcp-range=eth0,192.168.2.10,192.168.2.250,255.255.0.0,24h
dhcp-range=eth0,192.168.3.10,192.168.3.250,255.255.0.0,24h
dhcp-range=eth0,192.168.4.10,192.168.4.250,255.255.0.0,24h
But the answer is simply to increase the range in a single vlan (of course):
dhcp-range=eth0,192.168.1.150,192.168.4.250,255.255.0.0,24h