[Dnsmasq-discuss] dhcp-match option:hostname fails with syntax error

Simon Kelley simon at thekelleys.org.uk
Thu Feb 28 14:44:12 GMT 2013


This looks like a bug. The code is written not to accept the names of 
options that can't be set directly, like hostname, and that's carried 
over onto dhcp-match, which uses the same parsing code, but should 
accept all option names.

I think (but I've not actually tested0 that just using the option number 
will function, as a workaround.

dhcp-match=set:winpe, 12, minint-

I'll fix the bug in the next release.

Cheers,

Simon.


On 26/02/13 14:35, Benedikt Hochstrasser wrote:
> (dnsmasq 2.63 here)
>
> Hi list,
>
> I am currently setting up a small-time staging system for Windows
> clients. dnsmasq is to serve PXE requests (which boot a windows PE
> image) and DHCP requests from the aforementioned PE image, but should
> ignore everything else.
>
> Now, all Windows clients request their addresses with a vendor id
> "MSFT", so I cannot ignore all "MSFT" clients. But all PE images
> generate a host name in the form of "minint-abcdef" which is supplied in
> the DHCPDISCOVER message. So I just have to catch the client-supplied
> host name and tag it accordingly, right?
>
> In an earlier post
> (<http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2012q3/006206.html>)
> it was discussed how to wildcard-match host names, but when I enter
>
>     dhcp-match=set:winpe, option:hostname, minint-
>
> I get "dnsmasq: bad dhcp-option at line xyz"
>
> If I use
>
>     dhcp-match=set:winpe, option:domain-name, minint-
>
> then I get no error, but of course I won't get an address as the client
> is only supplying the hostname (option 12) and not a domain name. (I
> also tried host-name, "12" and every other option I could think of. It
> just fails when I use the option "hostname" which, according to line 459
> in dhcp-common.c, is the one I should use.) I also ran wireshark and the
> client is indeed supplying option 12.
>
> What am I doing wrong?
>
> (here's my config)
>
> filterwin2k
> interface=em0
> domain=staging.local,172.16.0.0/24 <http://172.16.0.0/24>
> # Common options
> dhcp-option=19,0
> dhcp-option=44,0.0.0.0
> dhcp-option=45,0.0.0.0
> dhcp-option=46,8
> dhcp-lease-max=150
> log-queries
> log-dhcp
> # PXE Clients
> dhcp-vendorclass=set:pxe,PXEClient
> dhcp-range=tag:pxe,172.16.0.150,172.16.0.199,2h
> dhcp-boot=tag:pxe,pxelinux.bin,nas4free,172.16.0.100
> # Windows Clients
> dhcp-vendorclass=set:msft,MSFT
> dhcp-match=set:winpe, option:hostname, minint-     # <----- Syntax error
> here
> dhcp-ignore=tag:!pxe,tag:!winpe
> dhcp-range=tag:winpe,172.16.0.200,172.16.0.249,2h
> dhcp-option=vendor:MSFT,1,2i
> dhcp-option=vendor:MSFT,2,1i
>
>
> Stumped in Zurich,
> --
> Ben
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>




More information about the Dnsmasq-discuss mailing list