[Dnsmasq-discuss] ignoring unknown devices ..

Ben abnormaliti at clivepeeters.com.au
Thu Nov 22 01:04:42 GMT 2007


richardvoigt at gmail.com wrote:
>
> On Nov 16, 2007 12:50 AM, Ben <abnormaliti at clivepeeters.com.au 
> <mailto:abnormaliti at clivepeeters.com.au>> wrote:
>
>     I need to setup dnsmasq to ignore unknown devices and I have been able
>     to do so with 2.40 but I have a configuration issue that I think
>     may be
>     a bug.
>
>     Here is what i want to have.
>
>        dhcp-range= 10.7.5.100 <http://10.7.5.100>,10.7.5.254
>     <http://10.7.5.254>,24h
>        dhcp-ignore=#known
>        dhcp-hostsfile=/etc/dnsmasq.d/#hostsfile#
>
>        dhcp-host=tc01, 10.7.5.13 <http://10.7.5.13>
>        dhcp-host=tc02,10.7.5.14 <http://10.7.5.14>
>
>     This should, in theory, allocate IPs to devices with  MAC addresses
>     listed in the '#hostsfile#' and devices named 'tc01' and 'tc02'.  But 
>
>
> MAC addresses are normally listed in /etc/ethers, not /etc/hosts.  I 
> see you're using the brand new hostsfile feature, I don't know what 
> version Simon implemented that but I think 2.40 is new enough.  What 
> format are the lines in the #hostsfile#?  If you are using a 
> hostsfile, why do you have dhcp-host lines in the main config?
The '#hostsfile#' file is just a list of MAC addesses, nothing else.  
The hostsfile is being used to restrict the devices that addresses are 
served too, not allocate fixed IP to anything, the "dhcp-host" entries 
in the main config are the devices i want to allocate fixed IP's too.  
The hostsfile is filled from a database of MAC addresses of all devices 
we have and changes regularly. 
>  
>
>
>     when "dhcp-ignore=#known" is defined 'tc01' and 'tc02' are ignored.
>
>     This config works, but requires the MAC for 'tc01' to be defined.
>
>        dhcp-range=10.7.5.100 <http://10.7.5.100>,10.7.5.254
>     <http://10.7.5.254> ,24h
>        dhcp-ignore=#known
>        dhcp-hostsfile=/etc/dnsmasq.d/#hostsfile#
>
>        dhcp-host=00:20:4a:9c:52:c2,10.7.5.13 <http://10.7.5.13>,tc01
>
>     So what i am looking for is to be able to use "#known" and
>     "hostsfile"
>     as well as allocate fixed IPs to devices by name.
>
>
> I think you need to put the fixed IPs into the hostsfile along with 
> the MAC address.  Or are you trying to match against the client 
> supplied ID?  That can't be trusted.
>
The problem is not the "hostsfile" it is the 'dhcp-ignore=#known'.  When 
'dhcp-ignore=#known' is defined the client supplied hostname is not matched.

The man page says "When a host matches any dhcp-host directive (or one 
implied by /etc/ethers) then the special network-id tag "known" is set. 
This allows dnsmasq to be configured to ignore requests from unknown 
machines using *--dhcp-ignore=#known"

*It appears the "any dhcp-host directive" may not be accurate because 
'dhcp-host=tc02,10.7.5.14 <http://10.7.5.14>' doesn't appear to work.

Is this a bug or by design?  if it is design the man pages needs 
updating to clarify the limitations of 'dhcp-ignore=#known'.

Ben




More information about the Dnsmasq-discuss mailing list