[Dnsmasq-discuss] problem distributing dhcp-option to certain net: hosts

Simon Kelley simon at thekelleys.org.uk
Mon May 22 20:41:51 BST 2006


Brent Cook wrote:
> On Monday 22 May 2006 13:09, Simon Kelley wrote:
> 
>>Brent Cook wrote:
>>
>>>Hi all,
>>>
>>>What I am trying to do is netboot a few different types of machines. I'm
>>>allowing dnsmasq to identify different machines by the MAC address
>>>prefix. For instance:
>>>
>>>dhcp-host=00:50:C2:*:*:*,net:pe-xes
>>>dhcp-option=net:pe-xes,17,"/srv/nfsroot/powerpc"
>>>dhcp-boot=net:pe-xes,kernel-xes,build,192.168.2.1
>>>
>>>The problem is that the 'dhcp-option' specification does not work. When a
>>>machine gets a DHCP reply, option 17 is not passed. If I change the
>>>dhcp-option to not check net: option, option 17 _is_ passed:
>>
>>Do you have a more specific dhcp-host line which matches this host?
> 
> 
> No, it is the only one. The match rule works for the dhcp-boot line, just not 
> the dhcp-option line.
> 
> 
>>dnsmasq will only find one dhcp-host line, so if there's another one
>>matching the whole MAC address or hostname or similar, then it will use
>>that, and not the one you show.
>>
>>To get round this, use the dhcp-mac directive: replace your dhcp-hsot
>>line with
>>
>>dhcp-mac=pe-xes,00:50:C2:*:*:*
>>
> 
> 
> I got it to work with the following:
> 
> dhcp-host=00:50:C2:*:*:*,net:pe-xes
> dhcp-option=pe-xes,17,"/srv/nfsroot/powerpc"
> dhcp-boot=net:pe-xes,kernel-xes,build,192.168.2.1
> 
> Looking at the man page again, it appears that this is consistent with the 
> documentation:
> 
> dhcp-option=[<network-id>,[<network-id>,]][vendor:<vendor-class>]<opt>,
> [<value>[,<value>]]
> 
> dhcp-boot=[net:<network-id>,]<filename>,[<servername>[,<server address>]]
> 
> So, the only problem here was that net: is not required consistently by 
> different dnsmasq options. So, dhcp-boot parses off the 'net:' part, and 
> dhcp-option literally sees 'net:pe-xes', which has no matching rule. I might 
> suggest allowing an optional and ignored net: prefix when a network-id is 
> used to avoid this confusion in the future, as in the following patch. I 
> don't care either way, now that I know what the issue is.
> 
> Thanks
>  - Brent

I can't really add anything to that excellent analysis: patch applied!

Cheers,

Simon.




More information about the Dnsmasq-discuss mailing list