[Dnsmasq-discuss] Re: negated network-ids (Re: dhcp: mac address
as "range selector"?)
Simon Kelley
simon at thekelleys.org.uk
Mon Feb 20 10:20:09 GMT 2006
Lutz Pressler wrote:
> Hello Simon,
>
> Am Samstag, 18. Februar 2006, Simon Kelley schrieb:
>
>>>What does "first matching" mean? I haven't tested, but why should
>>> dhcp-host=00:04:13:01:02:03,192.168.10.11
>>> dhcp-host=00:04:13:*:*:*,net:snow
>>>not work? Only the second line is matching e.g. 00:04:13:01:02:04.
>>>
>>
>>It's not defined. dnsmasq looks through the dhcp-host lines until if
>>find one which it can use, and then it stops. The order is arbitrary
>>because it's not normally sensible to have more than one dhcp-host line
>>usable at a time.
>>
>>This assumption is questionable when there are wildcards, hence my
>>warning and your question. The answer is "don't do that", you can assign
>> to a network using MAC-address wildcards, or you can assign an IP
>>address to a host, but you can't mix them.
>>
>
> Ok. As there are scenarios (see below) which are problematic as of now,
> what do you think of the following?
> Instead of overloading dhcp-host with functionality for purely defining
> network ids, add yet another option (dhcp-macaddress ?) behaving
> like dhcp-vendorclass etc.: every one with matching mac address or
> address wildcard is interpreted, multiple network ids can be set.
Excellent idea!
>
> At the moment in my example
>
> dhcp-vendorclass=tel,alcatel.noe.0
> dhcp-vendorclass=alcatel,alcatel.noe.0
> dhcp-host=00:04:13:*:*:*,net:tel
> dhcp-range=net:tel,192.168.71.2,192.168.71.5,255.255.255.248,12h
> dhcp-range=net:#tel,192.168.169.80,192.168.169.99,255.255.255.0,12h
> dhcp-boot=net:alcatel,,,192.168.70.3
>
> does work to allocate both Alcatel and SNOM phones addresses from
> 192.168.71.*, never from 192.168.169.*. Other devices get
> 192.168.169.* only.
> Alcatel phones do have boot server set, SNOM don't.
>
> If it's necessary to send SNOM phones another kind of option, I could
> change that into
>
> dhcp-vendorclass=tel,alcatel.noe.0
> dhcp-vendorclass=alcatel,alcatel.noe.0
> dhcp-host=00:04:13:*:*:*,net:snom
> dhcp-range=net:tel,192.168.71.2,192.168.71.5,255.255.255.248,12h
> dhcp-range=net:snom,192.168.71.2,192.168.71.5,255.255.255.248,12h
> dhcp-range=net:#tel,192.168.169.80,192.168.169.99,255.255.255.0,12h
> dhcp-boot=net:alcatel,,,192.168.70.3
> dhcp-option=snom,someoption
>
> - but now SNOM phones will also get addresses from 192.168.169.* if
> no one in 192.168.71.* is left. (Maybe it's even worse as preference of
> net:snom and net:#tel range is not defined?)
> Having the proposed option would allow to tag the SNOM phones with
> "tel" also.
>
> An alternative may be to allow multiple network id matches for dhcp-range
> (and dhcp-boot), like in dhcp-option, dhcp-ignore.
That's also sensible.
I'll work on these as I get time this week.
>
>
> Out of interest, why is it "#" and not "!" anyway?
Everything that's legal in /etc/dnsmasq.conf is also a legal long-option
on the command line, so it's possible to do
dnsmasq --dhcp-range=1.2.3.4,1.2.3.8
For a long time I kept to a policy of not using shell metacharacters in
the config language to make this simpler. (There are a few exceptions
now, '*' and '"', for instance.)
This is matter of history. Long ago, there wasn't a configuration file,
only command-line options. The config-file got added as a way to feed
options into the same code.
Cheers,
Simon.
>
> Greetings,
> Lutz
>
More information about the Dnsmasq-discuss
mailing list