[Dnsmasq-discuss] Re: negated network-ids (Re: dhcp: mac address as "range selector"?)

Lutz Pressler Lutz at Pressler.DE
Sat Feb 18 21:24:28 GMT 2006


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.

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.

> >>>I see no way to change that as it's not possible to negate network-id
> >>>usage or mapping.
> >>>
> >>
> >>Yes it is, though the documentation is well hidden in the man page, I 
> >>will admit
> > 
> > I read that, tested - and then interpreted "#" as being only relevant
> > in dhcp-option (btw, there is a typo --dhcp=option=#purple...).
Out of interest, why is it "#" and not "!" anyway?

Greetings,
  Lutz

-- 
Lutz Preßler, Göttingen, Germany 



More information about the Dnsmasq-discuss mailing list