DHCP IP assignment in dnsmasq

dhcpdnsmasq

I have the following configuration in my dnsmasq.conf:

dhcp-range=172.16.0.100,172.16.0.254,255.255.255.0,12h

From range 172.16.0.1-99 we assign static IP address to important servers and from 172.16.0.100-254 we assign dynamic addresses.

We started using OpenVPN some time ago and the server hosting the service created a lot of virtual interfaces, sometimes using all of the IP addresses the DHCP has, causing a mess in the network.

I wanted to change the network mask to 255.255.0.0, to increase the number of IP addresses and leave the static IP range untouched.

How can I achieve this using this dhcp-range attribute dnsmasq offers?

Best Answer

I'm not really familiar with dnsmasq, but couldn't you just make the network address 172.16.0.0 /16 and then just extend the dhcp range? Like this: dhcp-range=172.16.0.100, 172.16.255.254, 255.255.0.0, 12h(I'm assuming the 12h is the lease time and not something important)

Were you wanting to setup multiple discontiguous DHCP ranges using that syntax? for instance: (dhcp-range=172.16.0.100, 172.16.0.254, 255.255.255.0, 12h) and then (dhcp-range=172.16.1.100, 172.16.1.254, 255.255.255.0, 12h)? I don't see why you wouldn't be able to set as many dhcp ranges at whatever range you want. Unless the program itself stops you from doing this. But I've never had any problems setting up discontiguous DHCP pools on servers before myself.

(comments converted to answer)