Option negation

Niall O'Reilly niall.oreilly at ucd.ie
Wed May 4 13:12:58 UTC 2016


On 4 May 2016, at 13:20, John Hascall wrote:

> Unfortunately, I can't think of any way to do that.
>
> We have many thousands of IP phones.  I don't even have a list of them,
> all I have is the MAC prefix that I use to assign them to a group.
> The group sets their options, now I have a request that this one specific
> phone not get the options.

  If you have to deal with only a small enough number of exceptions,
  would something like this (modulo syntax errors of mine) work to
  include all phones with MAC address beginning aa:bb:cc except for
  the one with MAC address aa:bb:cc:dd:ee:ff.

class "normal-phones" {
  match if substring(hardware, 1, 3) = aa:bb:cc
    and not substring(hardware, 4, 3) = dd:ee:ff;
  ...
}

  The dhcp-eval manpage describes if/elsif/else and switch syntax
  for either of which only the first matched condition triggers
  a corresponding sequence of configuration directives.  This
  approach might give a more readable (and so more maintainable)
  configuration file.

  I hope this helps.

  Niall O'Reilly


More information about the dhcp-users mailing list