[Dnsmasq-discuss] DHCP options and SIGHUP
weizen_42 at ipcop-forum.de
Tue Jul 14 19:01:09 BST 2009
Hello Rance, Hello Simon,
>> I have a question and/or problem with using various DHCP options and
>> reloading them by using SIGHUP.
>> Following use case:
>> 'global' DHCP settings (rarely changing) and several static leases,
>> some of which using dhcp-boot for PXE boot.
>> Now I would like to reread the static leases after changes have been
>> made by using SIGHUP. No problem if I put the dhcp-host configuration
>> lines in a file referenced by dhcp-hostsfile, but what to do with the
>> dhcp-boot lines?
>> Any thoughts?
> It's (mostly) possible. The trick is to use dhcp-optsfile which, like
> dhcp-hostfile get re-read on SIGHUP.
> dhcp-optsfile contains dhcp-option lines, not dhcp-boot lines, but the
> filename and servername information in dhcp-boot can be represented as
> dhcp options.
> So, if you have
> dhcp-host=<mac address>,<IP address>,net:<tag>
> then you can put
> <mac address>,<IP address>,net:<tag>
> in a dhcp-hostfile
> in dhcp-optsfile
> and get the same effect, but the configuration is re-read on SIGHUP.
OK, that would work (most of it anyway, as you write below ;-))
To explain a bit more about how I (the project I am working on) handle
There is a 'GUI interface to dnsmasq DHCP', which is explained here:
The form to add static DHCP leases is this:
This adds lines to a config file which look like this:
Rance is correct to assume that the filename and server address are
very, very unlikely to be different and differentiating between PCs will
be done in pxelinux.cfg file.
Still the option is there and I would like to be able to use that.
> That should, of course, be
According to http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
both opt and option are valid?
The code in option.c thinks differently though ;-)
> The only thing that this doesn't work for is the server address field in
> dhcp-boot, since there's no option defined to represent this. As long as
> you're relying on the default that's OK. A "pseudo option" should
> probably be defined for this data too, to fix this hole.
Am I correct to assume that this requires an addition to opttab in
option.c (next-server-ip) and matching code in rfc2131.c?
If so, say the word and I will get at it :-), not before thursday though.
A weizen a day helps keep the doctor away.
More information about the Dnsmasq-discuss