[Dnsmasq-discuss] wip: Add tag: usage in dhcp-option
Wink Saville
wink at saville.com
Sat Sep 23 00:27:28 UTC 2023
On Fri, Sep 22, 2023 at 1:06 PM Geert Stappers <stappers at stappers.nl> wrote:
>
> On Thu, Sep 21, 2023 at 11:00:59PM -0700, Wink Saville wrote:
> > On Thu, Sep 21, 2023 at 10:47 PM Geert Stappers wrote:
> > > On Wed, Sep 20, 2023 at 09:14:13PM -0700, Wink Saville wrote:
> > > > --- a/man/dnsmasq.8
> > > > +++ b/man/dnsmasq.8
> > > > @@ -1317,6 +1317,34 @@
>
> ... work in progress ...
>
> > >
> > >
> > > The work in progress patch has been seen. At least by me.
> > >
> > > I think I have seen simular content in the existing man page.
> > >
> > > I hope the next version integrates with what is already there.
> > >
> >
> > Sorry, I have not seen multiple dhcp-options with the same tag documented
> > anywhere, can you provide some guidance on where it is?
>
> Sorry, not in the manual page but in configuration example:
> https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=dnsmasq.conf.example#l389
>
> # Specify an option which will only be sent to the "red" network
> # (see dhcp-range for the declaration of the "red" network)
> # Note that the tag: part must precede the option: part.
> #dhcp-option = tag:red, option:ntp-server, 192.168.1.1
>
>
> Groeten
> Geert Stappers
> --
> Silence is hard to parse
It is kinda an example, we do see two "tag:red" one you're pointing
out, which is a dhcp-option:
https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=dnsmasq.conf.example#l393
393 #dhcp-option = tag:red, option:ntp-server, 192.168.1.1
But the other is not a dhcp-option, instead its a dhcp-bootp:
https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=dnsmasq.conf.example#l527
527 #dhcp-boot=tag:red,pxelinux.red-net
My use is slightly different in that I'm specifically having multiple
dhcp-options with
the same tag and then using them in dhcp-host options. But this does lead me
to wonder how the 6 set:red instances work in dnsmasq.conf.example. Below
I've listed the 6 and provide an "explanation" sentence for each.
I'm thinking of at least adding one specific example of multiple
dhcp-options with
the same tag. Maybe that should just be adding another
"dhcp-option=tag:read, ...".
It might be also worth adding something like my "explanation" to these
particular lines
in dnsmasq.conf.example. Please "fix" any mistakes in the explanation sentences.
Also, I wonder if maybe there should be multiple dnsmasq.conf
examples. Having one
huge example seems overwhelming to the reader and also difficult for
the maintainers.
Breaking the single large example into a set of simpler and more
targeted examples
might be better, thoughts?
List of set:red with an explanation:
1) https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=dnsmasq.conf.example#l177
177 #dhcp-range=set:red,192.168.0.50,192.168.0.150
My guess is that this set:red "ignores" the two "tag:red" dhcp-option
ntp-server at line 393 and dhcp-bootp at line 527.
2) https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=dnsmasq.conf.example#l292
292 #dhcp-host=11:22:33:44:55:66,set:red
When this host asks for an address it will definitely get dhcp-option
ntp-server at line 393,
but I'm not sure about dhcp-bootp at line 527.
3) https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=dnsmasq.conf.example#l296
296 #dhcp-host=11:22:33:*:*:*,set:red
This is "exactly" the same as #2 above except there will be
potentially multiple hosts and
it actually covers #2 and is thus #2 redundant. (#2 should probably be
changed or removed)
4) https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=dnsmasq.conf.example#l312
312 #dhcp-vendorclass=set:red,Linux
Similar to #3 but it will be any host DHCP request with vendorclass of "Linux".
5) https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=dnsmasq.conf.example#l316
316 #dhcp-userclass=set:red,accounts
Similar to #3 but it will be any host DHCP request with userclass of "accounts".
6) https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=dnsmasq.conf.example#l320
320 #dhcp-mac=set:red,00:60:8C:*:*:*
Similar to #3 but it will be any host DHCP request with a MAC address
that starts with "00:60:8C".
-- Wink
More information about the Dnsmasq-discuss
mailing list