[Dnsmasq-discuss] Is there any use case for "--dhcp-range=0.0.0.0, static, 0.0.0.0" to support all subnet

Yuki Nisiwaki uckey.1067 at gmail.com
Mon Mar 12 08:00:40 GMT 2018


Hi dnsmasq guys.

I'm Yuki Nishiwaki.
Recently I started to work on dnsmasq stuff. I could ask stupid thing
though I want to ask if anyone think the same thing as me.

I'm using dnsmasq under cloud controller and dnsmasq have responsibility to
lease IP for
our all virtual machines connected to Host via tap on the same host running
dnsmasq.

In order to do that, I had to specify same number of --dhcp-range as the
number of subnet VM belong to but
we can not add dynamically "--dhcp-range" and I don't wanna restart
everytime new subnet added.

So I was going to specify "--dhcp-range=0.0.0.0,static,0.0.0.0"  or
"--dhcp-range=0.0.0.0,static,128.0.0.0,
--dhcp-range=128.0.0.0,static,128.0.0.0" to
support all subnets possibly will be added in the future and lease IP for
only known client.
It kind of worked but the netmask of leased IP was the same as dhcp-range
specified(/1).
I expected the netmask will be got from the NIC receiving DHCP request and
dhcp-range's netmask is only used for judging if dnsmasq should reply or
not.

After read the code around
https://github.com/imp/dnsmasq/blob/master/src/dhcp.c#L501-L561, I
understood why I can not.
But If there is any chance I can add new option or other behaviour to cover
my usecase
so that dnsmasq can use the netmask of NIC's IP receiving DHCP request for
the IP to be leased while the netmask dhcp-range specified is used to judge
whether
dnsmasq should reply or not, I'm willing to write the patch but
beforehand I want to ask what do you think about such additional change. Is
this good approach, feature or bad approach, feature nobody want but me?


Regards

Yuki Nishiwaki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20180312/91a50866/attachment.html>


More information about the Dnsmasq-discuss mailing list