option 82 config help

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

option 82 config help

project722
Hi all, we have a option 82 stanza setup on our rhel 6 server that includes the following:


if((option dhcp-message-type = 3 or option dhcp-message-type = 5) and exists agent.circuit-id) {
        log(info, concat( "OPTION-82 | IP =", binary-to-ascii (10, 8, ".",leased-address),
                " | MAC=", suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 1, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 2, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 3, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 4, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 5, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 6, 1))),2),
                #" | CIRCUIT-ID=", binary-to-ascii (10, 8, ".", option agent.circuit-id),
                #" | REMOTE-ID=", binary-to-ascii (10, 8, ".", option agent.remote-id),
                " | CIRCUIT-ID=", substring( option agent.circuit-id, 0, 9999),
                " | REMOTE-ID=", substring( option agent.remote-id, 0, 9999)));
}

This only logs option 82 data and we don't use it for making DHCP based decisions such as handing out IP's and such. The logs from this produce the following format:

Nov  9 18:56:56 servername dhcpd: OPTION-82 | IP =192.168.100.101 | MAC=00:0f:94:43:f4:10 | CIRCUIT-ID=Area1_TA5000 eth 2/6/15/1/1:200 | REMOTE-ID=647653__DATA_ETH1

We now have a need to capture option 82 data from a specific DHCP pool that can only send the MAC address in the CID and RID fields instead of the fields that you see above. Is it possible to create a new additional option 82 stanza just for the IP pool that can only send the MAC in the CID and RID fields without affecting the existing option 82 stanza above?


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

Re: option 82 config help

project722
I wanted to clarify a few things on my above post. The O82 logging config above is set globally. In order to accomplish my objective while still retaining the functionality of the config above, would it be possible to simply add a new logging config for option82 into the specific subnet or pool declaration where I want the new logging to occur? I think that may work and over-ride the exisitng 082 config, just for that one subnet/scope.

On Thu, Nov 9, 2017 at 7:04 PM, project722 <[hidden email]> wrote:
Hi all, we have a option 82 stanza setup on our rhel 6 server that includes the following:


if((option dhcp-message-type = 3 or option dhcp-message-type = 5) and exists agent.circuit-id) {
        log(info, concat( "OPTION-82 | IP =", binary-to-ascii (10, 8, ".",leased-address),
                " | MAC=", suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 1, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 2, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 3, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 4, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 5, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 6, 1))),2),
                #" | CIRCUIT-ID=", binary-to-ascii (10, 8, ".", option agent.circuit-id),
                #" | REMOTE-ID=", binary-to-ascii (10, 8, ".", option agent.remote-id),
                " | CIRCUIT-ID=", substring( option agent.circuit-id, 0, 9999),
                " | REMOTE-ID=", substring( option agent.remote-id, 0, 9999)));
}

This only logs option 82 data and we don't use it for making DHCP based decisions such as handing out IP's and such. The logs from this produce the following format:

Nov  9 18:56:56 servername dhcpd: OPTION-82 | IP =192.168.100.101 | MAC=00:0f:94:43:f4:10 | CIRCUIT-ID=Area1_TA5000 eth 2/6/15/1/1:200 | REMOTE-ID=647653__DATA_ETH1

We now have a need to capture option 82 data from a specific DHCP pool that can only send the MAC address in the CID and RID fields instead of the fields that you see above. Is it possible to create a new additional option 82 stanza just for the IP pool that can only send the MAC in the CID and RID fields without affecting the existing option 82 stanza above?



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

Re: option 82 config help

Christian Kratzer
Hi,

On Fri, 10 Nov 2017, project722 wrote:

> I wanted to clarify a few things on my above post. The O82 logging config
> above is set globally. In order to accomplish my objective while still
> retaining the functionality of the config above, would it be possible to
> simply add a new logging config for option82 into the specific subnet or
> pool declaration where I want the new logging to occur? I think that may
> work and over-ride the exisitng 082 config, just for that one subnet/scope.

I am pretty sure that logging is global functionality.  What I would try to do
is see if you can add two logging clauses globally and try to identify
your scenarious by some additional logic.

Greetings
Christian

--
Christian Kratzer                   CK Software GmbH
Email:   [hidden email]               Wildberger Weg 24/2
Phone:   +49 7032 893 997 - 0       D-71126 Gaeufelden
Fax:     +49 7032 893 997 - 9       HRB 245288, Amtsgericht Stuttgart
Mobile:  +49 171 1947 843           Geschaeftsfuehrer: Christian Kratzer
Web:     http://www.cksoft.de/
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: option 82 config help

project722
Thanks. Given my current setup, and my new scenario I described, any ideas on what that logic would look like with dual logging clauses?

On Fri, Nov 10, 2017 at 8:04 AM, Christian Kratzer <[hidden email]> wrote:
Hi,

On Fri, 10 Nov 2017, project722 wrote:

I wanted to clarify a few things on my above post. The O82 logging config
above is set globally. In order to accomplish my objective while still
retaining the functionality of the config above, would it be possible to
simply add a new logging config for option82 into the specific subnet or
pool declaration where I want the new logging to occur? I think that may
work and over-ride the exisitng 082 config, just for that one subnet/scope.

I am pretty sure that logging is global functionality.  What I would try to do
is see if you can add two logging clauses globally and try to identify
your scenarious by some additional logic.

Greetings
Christian

--
Christian Kratzer                   CK Software GmbH
Email:   [hidden email]               Wildberger Weg 24/2
Phone:   <a href="tel:%2B49%207032%20893%20997%20-%200" value="+4970328939970" target="_blank">+49 7032 893 997 - 0       D-71126 Gaeufelden
Fax:     <a href="tel:%2B49%207032%20893%20997%20-%209" value="+4970328939979" target="_blank">+49 7032 893 997 - 9       HRB 245288, Amtsgericht Stuttgart
Mobile:  <a href="tel:%2B49%20171%201947%20843" value="+491711947843" target="_blank">+49 171 1947 843           Geschaeftsfuehrer: Christian Kratzer
Web:     http://www.cksoft.de/
_______________________________________________
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 82 config help

project722
Pretty sure I can parse out the CID's and RID's, but I have no idea how to tell it to use the second logging clause just for a specific subnet.

On Fri, Nov 10, 2017 at 8:24 AM, project722 <[hidden email]> wrote:
Thanks. Given my current setup, and my new scenario I described, any ideas on what that logic would look like with dual logging clauses?

On Fri, Nov 10, 2017 at 8:04 AM, Christian Kratzer <[hidden email]> wrote:
Hi,

On Fri, 10 Nov 2017, project722 wrote:

I wanted to clarify a few things on my above post. The O82 logging config
above is set globally. In order to accomplish my objective while still
retaining the functionality of the config above, would it be possible to
simply add a new logging config for option82 into the specific subnet or
pool declaration where I want the new logging to occur? I think that may
work and over-ride the exisitng 082 config, just for that one subnet/scope.

I am pretty sure that logging is global functionality.  What I would try to do
is see if you can add two logging clauses globally and try to identify
your scenarious by some additional logic.

Greetings
Christian

--
Christian Kratzer                   CK Software GmbH
Email:   [hidden email]               Wildberger Weg 24/2
Phone:   <a href="tel:%2B49%207032%20893%20997%20-%200" value="+4970328939970" target="_blank">+49 7032 893 997 - 0       D-71126 Gaeufelden
Fax:     <a href="tel:%2B49%207032%20893%20997%20-%209" value="+4970328939979" target="_blank">+49 7032 893 997 - 9       HRB 245288, Amtsgericht Stuttgart
Mobile:  <a href="tel:%2B49%20171%201947%20843" value="+491711947843" target="_blank">+49 171 1947 843           Geschaeftsfuehrer: Christian Kratzer
Web:     http://www.cksoft.de/
_______________________________________________
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 82 config help

perl-list
In my experience, if you add a second logging clause, it will merely log twice.  It won't override the existing logging clause.


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

Re: option 82 config help

project722
So are you saying its possible and that the second logging that occurs would be the data from the second clause, which parses out differently then the first?

On Fri, Nov 10, 2017 at 8:33 AM, perl-list <[hidden email]> wrote:
In my experience, if you add a second logging clause, it will merely log twice.  It won't override the existing logging clause.


_______________________________________________
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 82 config help

perl-list
That has been my experience, yes.  We used it this way when there were mixed relay agents transmitting option 82 in binary or ASCII depending on the manufacturer.  Both lines print.  One has the goods, the other maybe just some funky characters :)

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

Re: option 82 config help

Bill Shirley-2
In reply to this post by project722
Just a thought (untested):
subnet 192.168.6.0 netmask 255.255.255.0 {
.
.
    pool {
        set special82 = "yes";
        allow members of "something";
        deny dynamic bootp clients;
        range 192.168.6.64    192.168.6.95;
    }
    pool {
        set special82 = "no";
        deny members of "something";
        deny dynamic bootp clients;

        range 192.168.6.64    192.168.6.95;
    }
}
.
.
if special82 = "yes" {
    log ( info,
        "blah blah your stuff here"
    );
}

Hope this helps,
Bill

On 11/10/2017 8:03 AM, project722 wrote:
I wanted to clarify a few things on my above post. The O82 logging config above is set globally. In order to accomplish my objective while still retaining the functionality of the config above, would it be possible to simply add a new logging config for option82 into the specific subnet or pool declaration where I want the new logging to occur? I think that may work and over-ride the exisitng 082 config, just for that one subnet/scope.

On Thu, Nov 9, 2017 at 7:04 PM, project722 <[hidden email]> wrote:
Hi all, we have a option 82 stanza setup on our rhel 6 server that includes the following:


if((option dhcp-message-type = 3 or option dhcp-message-type = 5) and exists agent.circuit-id) {
        log(info, concat( "OPTION-82 | IP =", binary-to-ascii (10, 8, ".",leased-address),
                " | MAC=", suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 1, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 2, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 3, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 4, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 5, 1))),2),":",
                suffix (concat("0", binary-to-ascii (16, 8, "", substring( hardware, 6, 1))),2),
                #" | CIRCUIT-ID=", binary-to-ascii (10, 8, ".", option agent.circuit-id),
                #" | REMOTE-ID=", binary-to-ascii (10, 8, ".", option agent.remote-id),
                " | CIRCUIT-ID=", substring( option agent.circuit-id, 0, 9999),
                " | REMOTE-ID=", substring( option agent.remote-id, 0, 9999)));
}

This only logs option 82 data and we don't use it for making DHCP based decisions such as handing out IP's and such. The logs from this produce the following format:

Nov  9 18:56:56 servername dhcpd: OPTION-82 | IP =192.168.100.101 | MAC=00:0f:94:43:f4:10 | CIRCUIT-ID=Area1_TA5000 eth 2/6/15/1/1:200 | REMOTE-ID=647653__DATA_ETH1

We now have a need to capture option 82 data from a specific DHCP pool that can only send the MAC address in the CID and RID fields instead of the fields that you see above. Is it possible to create a new additional option 82 stanza just for the IP pool that can only send the MAC in the CID and RID fields without affecting the existing option 82 stanza above?




_______________________________________________
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