Discussion:
[Dnsmasq-discuss] dhcp-range broke in 2.76
Matthew Keeler
2016-07-06 14:31:05 UTC
Permalink
I have been using dnsmasq for a while on my local network with several dhcp
ranges specified. One of them no longer parses in v2.76 although it did in
v2.75.

dhcp-range=10.3.2.1,10.3.2.127,static,255.255.254.0,infinite

It looks like it is now no longer valid to have a start and end ipv4
address with the static mode where this was allowed previously. Was this an
intentional removal? My understanding (which may be incorrect) was that to
have a ip range reserved for dhcp reservations required having the dhcp
range specified and the dhcp-hosts specified to ips that fall within that
range. Then that range would have the static mode to prevent auto
assignment of ips to other unknown hosts.

If this is intended behavior and not a bug, how can I allocate an IP range
for DHCP reservations? I think something like the following should work to
produce the same results although it is a rather ugly solution as it
requires adding tags in many, many places.

dhcp-range=tag:reserved,10.3.2.1,10.3.2.127,255.255.254.0,infinite
dhcp-host=00:01:02:03:04:05,set:reserved,10.3.2.7,myhost
--
Matthew Keeler
Albert ARIBAUD
2016-07-06 15:45:39 UTC
Permalink
Hi Matthew,

Le Wed, 6 Jul 2016 10:31:05 -0400
Post by Matthew Keeler
I have been using dnsmasq for a while on my local network with
several dhcp ranges specified. One of them no longer parses in v2.76
although it did in v2.75.
dhcp-range=10.3.2.1,10.3.2.127,static,255.255.254.0,infinite
It looks like it is now no longer valid to have a start and end ipv4
address with the static mode where this was allowed previously. Was
this an intentional removal? My understanding (which may be
incorrect) was that to have a ip range reserved for dhcp reservations
required having the dhcp range specified and the dhcp-hosts specified
to ips that fall within that range. Then that range would have the
static mode to prevent auto assignment of ips to other unknown hosts.
If this is intended behavior and not a bug, how can I allocate an IP
range for DHCP reservations? I think something like the following
should work to produce the same results although it is a rather ugly
solution as it requires adding tags in many, many places.
dhcp-range=tag:reserved,10.3.2.1,10.3.2.127,255.255.254.0,infinite
dhcp-host=00:01:02:03:04:05,set:reserved,10.3.2.7,myhost
What do you mean by "reservations"? Static leases? For that you need
nothing more than a dhcp-host= line mapping the MAC or DUID to a static
IPv4 address, for each static lease you want.

The static keyword in dhcp-range= tells dnsmasq to not do dynamic
allocation, so basically a range is useless (as far as allocation is
concerned) if you specify static.

I personally define my dhcp-range= line without static and with a
small range for the odd guest machine, and my dhcp-host= lines with IPv4
addresses lying outside that range -- but even if a static lease IP
address fell within the dynamic DHCP range, dnsmasq would not use that
address for dynamic allocation.

Amicalement,
--
Albert.
Matthew Keeler
2016-07-06 16:20:14 UTC
Permalink
Yes, I have other dhcp-ranges for other types of hosts, I just also had a
static one where all my static leases got lumped into. So the dhcp server
should still run. All my other ranges were not experiencing parsing issues
after the upgrade so I didn’t mention them before.
--
Matthew Keeler

On July 6, 2016 at 12:16:30, Albert ARIBAUD (***@free.fr) wrote:

Hi again Matthew,

Le Wed, 6 Jul 2016 08:54:55 -0700
Thank you Albert. I guess where I was going wrong was thinking that
the static lease addresses referenced in a dhcp-host config needed to
fall within another configured dhcp-range. So I guess I should just
be able to remove that line from my configuration and have the same
behavior as before (the first 128 ips in my subnet not being
dynamically allocated but needing dhcp-host configurations).
You will need the dhcp-range option, as it is the one which enables
the DHCP server.

If you don't need dynamic allocation, but cannot use the 'static'
keyword, then you can set the dynamic range within the 128 address
range for which you have dhcp-host lines defined. Basically, it will
make dnsmasq reject or ignore any requests not in the ones statically
defined.

Amicalement,
--
Albert.
Simon Kelley
2016-07-07 14:46:10 UTC
Permalink
http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2016q1/010386.html
is relevant.

the short answer is that your dhcp-range never was valid, and parsing
has been tightened up to reject it rather than misunderstanding it.

Cheers,

Simon.
Post by Matthew Keeler
I have been using dnsmasq for a while on my local network with several dhcp
ranges specified. One of them no longer parses in v2.76 although it did in
v2.75.
dhcp-range=10.3.2.1,10.3.2.127,static,255.255.254.0,infinite
It looks like it is now no longer valid to have a start and end ipv4
address with the static mode where this was allowed previously. Was this an
intentional removal? My understanding (which may be incorrect) was that to
have a ip range reserved for dhcp reservations required having the dhcp
range specified and the dhcp-hosts specified to ips that fall within that
range. Then that range would have the static mode to prevent auto
assignment of ips to other unknown hosts.
If this is intended behavior and not a bug, how can I allocate an IP range
for DHCP reservations? I think something like the following should work to
produce the same results although it is a rather ugly solution as it
requires adding tags in many, many places.
dhcp-range=tag:reserved,10.3.2.1,10.3.2.127,255.255.254.0,infinite
dhcp-host=00:01:02:03:04:05,set:reserved,10.3.2.7,myhost
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Loading...