Option negation

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Option negation

John Hascall

I know that options set in more specific scopes override those set in less specific scopes, but can I "undo" an option setting?  That is, lets imagine I have this:

option option-66 code 66 = text;

and then in a class scope, I have:

class "someclass" {
​​
​        ​
match substring(hardware, 1, 3);
​        ​
option option-66 "blah blah blah";
}
subclass "
​someclass
" 00:0
​1​
:
​02​
;

I know that, given that host whatever falls in that class scope, that:

host whatever {
​        hardware ethernet 00:01:02:03:04:05;​
​        
option option-66 "fe fi fo fum";
}

works
​ to change its option​
, but what if
​I ​
want host whatever not to get
​ that option at all?  How do I do that???

host whatever {
​        ​
hardware ethernet 00:01:02:03:04:05;​

        no option​ option-66;       <== just making this up
}

​Many Thanks!
John​


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Option negation

glenn.satchell
This topic comes up from time to time. Unfortunately there is no way to
remove an option. The best you can currently do is set it to a null or
empty string, but this is not the same as not sending the option.

regards,
-glenn

On Wed, May 4, 2016 6:11 am, John Hascall wrote:

> I know that options set in more specific scopes override those set in less
> specific scopes, but can I "undo" an option setting?  That is, lets
> imagine
> I have this:
>
> option option-66 code 66 = text;
>
>
> and then in a class scope, I have:
>
> class "someclass" {
> ​​
> ​        â€‹
> match substring(hardware, 1, 3);
> ​        â€‹
>
> *option option-66 "blah blah blah";*}
> subclass "
> ​someclass
> " 00:0
> ​1​
> :
> ​02​
> ;
>
>
> I know that, given that host whatever falls in that class scope, that:
>
> host whatever {
>
> ​        hardware ethernet 00:01:02:03:04:05;​
>
> ​
> *option option-66 "fe fi fo fum";*
> }
>
>
> works
> ​ to change its option​
> , but what if
> ​I ​
> want *host whatever* not to get
> ​ that option at all?  How do I do that???
>
> host whatever {
> ​        â€‹
> hardware ethernet 00:01:02:03:04:05;​
>
>         *no option​ option-66;       <== just making this up*
> }
>
>
> ​Many Thanks!
> John​
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

RE: Option negation

Patrick Trapp
I had not realized that a host entry would inherit from more general configuration entries. It's not something I've really looked at despite many active host entries on my system.

Can you reverse the order so that the configuration without an option is what the larger group qualifies for first and your devices requiring the specific option are the ones that are the special cases.

Alternatively, can you disqualify the devices requiring no option so they do not receive the configuration with the unwanted option at all? Same idea, potentially very different execution.

Patrick

________________________________________
From: [hidden email] [[hidden email]] on behalf of Glenn Satchell [[hidden email]]
Sent: Wednesday, May 04, 2016 1:20 AM
To: Users of ISC DHCP
Subject: Re: Option negation

This topic comes up from time to time. Unfortunately there is no way to
remove an option. The best you can currently do is set it to a null or
empty string, but this is not the same as not sending the option.

regards,
-glenn

On Wed, May 4, 2016 6:11 am, John Hascall wrote:

> I know that options set in more specific scopes override those set in less
> specific scopes, but can I "undo" an option setting?  That is, lets
> imagine
> I have this:
>
> option option-66 code 66 = text;
>
>
> and then in a class scope, I have:
>
> class "someclass" {
> ​​
> ​        â€‹
> match substring(hardware, 1, 3);
> ​        â€‹
>
> *option option-66 "blah blah blah";*}
> subclass "
> ​someclass
> " 00:0
> ​1​
> :
> ​02​
> ;
>
>
> I know that, given that host whatever falls in that class scope, that:
>
> host whatever {
>
> ​        hardware ethernet 00:01:02:03:04:05;​
>
> ​
> *option option-66 "fe fi fo fum";*
> }
>
>
> works
> ​ to change its option​
> , but what if
> ​I ​
> want *host whatever* not to get
> ​ that option at all?  How do I do that???
>
> host whatever {
> ​        â€‹
> hardware ethernet 00:01:02:03:04:05;​
>
>         *no option​ option-66;       <== just making this up*
> }
>
>
> ​Many Thanks!
> John​
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Option negation

John Hascall
In reply to this post by glenn.satchell
Thanks for your reply.

John
PS, ISC, that's bogus.

On Wed, May 4, 2016 at 1:20 AM, Glenn Satchell <[hidden email]> wrote:
This topic comes up from time to time. Unfortunately there is no way to
remove an option. The best you can currently do is set it to a null or
empty string, but this is not the same as not sending the option.

regards,
-glenn

On Wed, May 4, 2016 6:11 am, John Hascall wrote:
> I know that options set in more specific scopes override those set in less
> specific scopes, but can I "undo" an option setting?  That is, lets
> imagine
> I have this:
>
> option option-66 code 66 = text;
>
>
> and then in a class scope, I have:
>
> class "someclass" {
> ​​
> ​        ​
> match substring(hardware, 1, 3);
> ​        ​
>
> *option option-66 "blah blah blah";*}
> subclass "
> ​someclass
> " 00:0
> ​1​
> :
> ​02​
> ;
>
>
> I know that, given that host whatever falls in that class scope, that:
>
> host whatever {
>
> ​        hardware ethernet 00:01:02:03:04:05;​
>
> ​
> *option option-66 "fe fi fo fum";*
> }
>
>
> works
> ​ to change its option​
> , but what if
> ​I ​
> want *host whatever* not to get
> ​ that option at all?  How do I do that???
>
> host whatever {
> ​        ​
> hardware ethernet 00:01:02:03:04:05;​
>
>         *no option​ option-66;       <== just making this up*
> }
>
>
> ​Many Thanks!
> John​
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Option negation

John Hascall
In reply to this post by Patrick Trapp
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.

Thanks though!

John

On Wed, May 4, 2016 at 7:10 AM, Patrick Trapp <[hidden email]> wrote:
I had not realized that a host entry would inherit from more general configuration entries. It's not something I've really looked at despite many active host entries on my system.

Can you reverse the order so that the configuration without an option is what the larger group qualifies for first and your devices requiring the specific option are the ones that are the special cases.

Alternatively, can you disqualify the devices requiring no option so they do not receive the configuration with the unwanted option at all? Same idea, potentially very different execution.

Patrick

________________________________________
From: [hidden email] [[hidden email]] on behalf of Glenn Satchell [[hidden email]]
Sent: Wednesday, May 04, 2016 1:20 AM
To: Users of ISC DHCP
Subject: Re: Option negation

This topic comes up from time to time. Unfortunately there is no way to
remove an option. The best you can currently do is set it to a null or
empty string, but this is not the same as not sending the option.

regards,
-glenn

On Wed, May 4, 2016 6:11 am, John Hascall wrote:
> I know that options set in more specific scopes override those set in less
> specific scopes, but can I "undo" an option setting?  That is, lets
> imagine
> I have this:
>
> option option-66 code 66 = text;
>
>
> and then in a class scope, I have:
>
> class "someclass" {
> ​​
> ​        ​
> match substring(hardware, 1, 3);
> ​        ​
>
> *option option-66 "blah blah blah";*}
> subclass "
> ​someclass
> " 00:0
> ​1​
> :
> ​02​
> ;
>
>
> I know that, given that host whatever falls in that class scope, that:
>
> host whatever {
>
> ​        hardware ethernet 00:01:02:03:04:05;​
>
> ​
> *option option-66 "fe fi fo fum";*
> }
>
>
> works
> ​ to change its option​
> , but what if
> ​I ​
> want *host whatever* not to get
> ​ that option at all?  How do I do that???
>
> host whatever {
> ​        ​
> hardware ethernet 00:01:02:03:04:05;​
>
>         *no option​ option-66;       <== just making this up*
> }
>
>
> ​Many Thanks!
> John​
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Option negation

Patrick Trapp
The only reason I am replying at this hour is because I should be working on something else, but there's an idea I can't quite fully express that a single device should be doable here.

Hopefully I have time when the thought fully forms to share it. Heck, maybe I can test it even!

PS to your PS: I'm not sure where a person enters feature requests, but I believe what attention you will get from ISC-affiliated individuals on this list is on their own time, so an official response might require a more official route. Enough people making the request should see it move up in importance. Just my opinion, though.

On May 4, 2016, at 7:20 AM, John Hascall <[hidden email]> 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.

Thanks though!

John

On Wed, May 4, 2016 at 7:10 AM, Patrick Trapp <[hidden email]> wrote:
I had not realized that a host entry would inherit from more general configuration entries. It's not something I've really looked at despite many active host entries on my system.

Can you reverse the order so that the configuration without an option is what the larger group qualifies for first and your devices requiring the specific option are the ones that are the special cases.

Alternatively, can you disqualify the devices requiring no option so they do not receive the configuration with the unwanted option at all? Same idea, potentially very different execution.

Patrick

________________________________________
From: [hidden email] [[hidden email]] on behalf of Glenn Satchell [[hidden email]]
Sent: Wednesday, May 04, 2016 1:20 AM
To: Users of ISC DHCP
Subject: Re: Option negation

This topic comes up from time to time. Unfortunately there is no way to
remove an option. The best you can currently do is set it to a null or
empty string, but this is not the same as not sending the option.

regards,
-glenn

On Wed, May 4, 2016 6:11 am, John Hascall wrote:
> I know that options set in more specific scopes override those set in less
> specific scopes, but can I "undo" an option setting?  That is, lets
> imagine
> I have this:
>
> option option-66 code 66 = text;
>
>
> and then in a class scope, I have:
>
> class "someclass" {
> ​​
> ​        ​
> match substring(hardware, 1, 3);
> ​        ​
>
> *option option-66 "blah blah blah";*}
> subclass "
> ​someclass
> " 00:0
> ​1​
> :
> ​02​
> ;
>
>
> I know that, given that host whatever falls in that class scope, that:
>
> host whatever {
>
> ​        hardware ethernet 00:01:02:03:04:05;​
>
> ​
> *option option-66 "fe fi fo fum";*
> }
>
>
> works
> ​ to change its option​
> , but what if
> ​I ​
> want *host whatever* not to get
> ​ that option at all?  How do I do that???
>
> host whatever {
> ​        ​
> hardware ethernet 00:01:02:03:04:05;​
>
>         *no option​ option-66;       <== just making this up*
> }
>
>
> ​Many Thanks!
> John​
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Option negation

Niall O'Reilly
In reply to this post by John Hascall
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
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users