Match on suboption of option 43 vendor-encapsulated-options

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

Match on suboption of option 43 vendor-encapsulated-options

Bob Harold
I have Cisco cable modems and will soon deploy another vendor's modem that needs a different set of options, but both use the same vendor-class-identifier "docsis3.0:", so I want to match on the "vendor-name" which is suboption 10 in option 43 vendor-encapsulated-options.  To start, I am trying to get DHCP to log the value, but I am failing somewhere.

Wireshark shows that the REQUEST packet includes:

    Option: (43) Vendor-Specific Information (CableLabs)
        Length: 103
...
        Option 43 Suboption: (10) Vendor Name
            Length: 5
            Vendor Name: Cisco

I have put this in dhcpd.conf:

log (info, concat( "extra logging vendorID=", pick-first-value( option vendor-class-identifier, "no-vendor-class-id" ) ) );
set vendor-string = option vendor-class-identifier;
option space docsis;
option docsis.vendor-name code 10 = text;
class "docsis" {
match if option vendor-class-identifier = "docsis3.0:";
vendor-option-space docsis;
log (info, concat( "extra logging vendor-name=", pick-first-value( option docsis.vendor-name, "no-vendor-name" ) ) );
log (info, concat( "extra vendor-encapsulated-options ", pick-first-value( binary-to-ascii( 16, 8, ":", vendor-encapsulated-options ), "no-vend-opt" ) ) );
log (info, concat( "extra vivso ", pick-first-value( binary-to-ascii( 16, 8, ":", vivso), "no-vivso" ) ) );
}
class "cisco" {
match if ( ( substring(hardware,1,3) = 08:80:39 ) or
( substring(hardware,1,3) = 10:5f:49 ) or
( substring(hardware,1,3) = 34:bd:fa ) or
( substring(hardware,1,3) = 54:d4:6f ) or
( substring(hardware,1,3) = 68:ee:96 ) or
( substring(hardware,1,3) = e4:48:c7) );
log (info, "extra class cisco" );
}

But I get this in the log file:

Feb 26 14:13:08 adonis12 dhcpd: extra class cisco
Feb 26 14:13:08 adonis12 dhcpd: extra logging vendor-name=no-vendor-name
Feb 26 14:13:08 adonis12 dhcpd: extra vendor-encapsulated-options no-vend-opt
Feb 26 14:13:08 adonis12 dhcpd: extra vivso no-vivso
Feb 26 14:13:08 adonis12 dhcpd: DHCPREQUEST for 10.213.139.100 from 54:d4:6f:d0:28:2e via 10.213.139.97
Feb 26 14:13:08 adonis12 dhcpd: DHCPACK on 10.213.139.100 to 54:d4:6f:d0:28:2e via 10.213.139.97

Is there something wrong in my log syntax?
Is there any way to turn up DHCP debugging to the point where it tells me all the fields that it reads from each packet?
Has anyone else matched or logged a suboption of option 43?

I would be glad to post more of the gory details, just let me know what you want to see.  I was hoping to avoid a really long email.

--
Bob Harold
University of Michigan


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

Re: Match on suboption of option 43 vendor-encapsulated-options

André Mamitzsch
That's how we do it:

#### Option 43 Option Space ####
option space CM;
option CM.devtype     code 2  = text;
option CM.esafetype   code 3  = text;
option CM.sernum      code 4  = text;
option CM.hwver       code 5  = text;
option CM.swver       code 6  = text;
option CM.bootrom     code 7  = text;
option CM.OUI         code 8  = string;
option CM.modnum      code 9  = text;
option CM.vendor      code 10 = text;
option CM-43 code 43 = encapsulate CM;

on commit {
log(info,
concat("VENDORLOG FOR ",
binary-to-ascii(10,8,".",leased-address),
" with vendor information",
" ",option CM.devtype,
" ",option CM.vendor,
" ",option CM.hwver,
" ",option CM.swver,
" ",option CM.sernum,
" ",
concat (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))
)
);
}

Regards,

André

Am 26.02.2016 um 20:31 schrieb Bob Harold:

> I have Cisco cable modems and will soon deploy another vendor's modem that needs a different set of options, but both use the same vendor-class-identifier "docsis3.0:", so I want to match on the "vendor-name" which is suboption 10 in option 43 vendor-encapsulated-options.  To start, I am trying to get DHCP to log the value, but I am failing somewhere.
>
> Wireshark shows that the REQUEST packet includes:
>
>     Option: (43) Vendor-Specific Information (CableLabs)
>         Length: 103
> ...
>         Option 43 Suboption: (10) Vendor Name
>             Length: 5
>             Vendor Name: Cisco
>
> I have put this in dhcpd.conf:
>
> log (info, concat( "extra logging vendorID=", pick-first-value( option vendor-class-identifier, "no-vendor-class-id" ) ) );
> set vendor-string = option vendor-class-identifier;
> option space docsis;
> option docsis.vendor-name code 10 = text;
> class "docsis" {
> match if option vendor-class-identifier = "docsis3.0:";
> vendor-option-space docsis;
> log (info, concat( "extra logging vendor-name=", pick-first-value( option docsis.vendor-name, "no-vendor-name" ) ) );
> log (info, concat( "extra vendor-encapsulated-options ", pick-first-value( binary-to-ascii( 16, 8, ":", vendor-encapsulated-options ), "no-vend-opt" ) ) );
> log (info, concat( "extra vivso ", pick-first-value( binary-to-ascii( 16, 8, ":", vivso), "no-vivso" ) ) );
> }
> class "cisco" {
> match if ( ( substring(hardware,1,3) = 08:80:39 ) or
> ( substring(hardware,1,3) = 10:5f:49 ) or
> ( substring(hardware,1,3) = 34:bd:fa ) or
> ( substring(hardware,1,3) = 54:d4:6f ) or
> ( substring(hardware,1,3) = 68:ee:96 ) or
> ( substring(hardware,1,3) = e4:48:c7) );
> log (info, "extra class cisco" );
> }
>
> But I get this in the log file:
>
> Feb 26 14:13:08 adonis12 dhcpd: extra class cisco
> Feb 26 14:13:08 adonis12 dhcpd: extra logging vendor-name=no-vendor-name
> Feb 26 14:13:08 adonis12 dhcpd: extra vendor-encapsulated-options no-vend-opt
> Feb 26 14:13:08 adonis12 dhcpd: extra vivso no-vivso
> Feb 26 14:13:08 adonis12 dhcpd: DHCPREQUEST for 10.213.139.100 from 54:d4:6f:d0:28:2e via 10.213.139.97
> Feb 26 14:13:08 adonis12 dhcpd: DHCPACK on 10.213.139.100 to 54:d4:6f:d0:28:2e via 10.213.139.97
>
> Is there something wrong in my log syntax?
> Is there any way to turn up DHCP debugging to the point where it tells me all the fields that it reads from each packet?
> Has anyone else matched or logged a suboption of option 43?
>
> I would be glad to post more of the gory details, just let me know what you want to see.  I was hoping to avoid a really long email.
>
> --
> Bob Harold
> University of Michigan
>
>
>
> _______________________________________________
> 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

smime.p7s (5K) Download Attachment