Sending dynamic boot filename to clients

Darren Ankney darren.ankney at gmail.com
Mon Oct 30 12:57:36 UTC 2023


Hi Dave,

Perhaps it is due to the difference here:

        option docsis.configuration-file = concat("cache/ONU-", configfile);
        #option docsis.configuration-file "cache/3basic_OLT.cfg";

note that the first line contains an '=' and the second does not.
I've not done what you are doing, so I don't know for sure if the
equal sign would be required.  Just something to try?  If that doesn't
work, I'd try performing the entire concat while setting the variable,
like so:

set configfile = concat("cache/ONU-", hw_mac_short, ".cfg");

Then you could set the option like so:

option docsis.configuration-file configfile;

which I assume would work but haven't tested.

Thank you,

Darren Ankney

On Mon, Oct 30, 2023 at 1:09 PM Dave M <2wheelsyyz at gmail.com> wrote:
>
> Hello,
>
> I'm currently running version isc-dhcpd-4.4.1 on Ubuntu 20.04. I'm planning to migrate to Kea but having tried the configuration assistant left me with more questions than answers to I will need to manually build this config and it will be a month long project.
>
> I'm trying to set the boot file name for my clients dhcp6 to be dynamically generated based on the client-id. I have a similar setup working on dhcp4 but can't get it to work on IPv6. These are DOCSIS cable modems trying to boot and acquire their config.
>
> What I have setup is the following
>
> # declare the option space where the CableLabs options live
> option space docsis code width 2 length width 2 hash size 100;
> option docsis.tftp-servers code 32 = array of ip6-address;
> option docsis.configuration-file code 33 = text;
> option docsis.syslog-servers code 34 = array of ip6-address;
> option docsis.time-servers code 37 = array of ip6-address;
> option docsis.time-offset code 38 = signed integer 32;
> option vsio.docsis code 4491 = encapsulate docsis;
>
> subnet6 2001:428:XXXX:1300::/64 {
>         range6 2001:428:XXXX:1300::ff01 2001:428:XXXX:1300::ffff;
>         set hw_mac_short = concat (
>               suffix(concat("0", binary-to-ascii (16, 8, "", substring(suffix(option dhcp6.client-id, 6),0,1))),2),
>               suffix(concat("0", binary-to-ascii (16, 8, "", substring(suffix(option dhcp6.client-id, 6),1,1))),2),
>               suffix(concat("0", binary-to-ascii (16, 8, "", substring(suffix(option dhcp6.client-id, 6),2,1))),2),
>               suffix(concat("0", binary-to-ascii (16, 8, "", substring(suffix(option dhcp6.client-id, 6),3,1))),2),
>               suffix(concat("0", binary-to-ascii (16, 8, "", substring(suffix(option dhcp6.client-id, 6),4,1))),2),
>               suffix(concat("0", binary-to-ascii (16, 8, "", substring(suffix(option dhcp6.client-id, 6),5,1))),2)
>               );
>         set configfile = concat(hw_mac_short, ".cfg");
>         log (info, "Sending config...");
>         log (info, concat ("Sending config file ", configfile, " to device ", hw_mac_short));
>         option dhcp6.domain-search "cm.den.company.com";
>         option docsis.time-offset -24200;
>         option docsis.configuration-file = concat("cache/ONU-", configfile);
>         #option docsis.configuration-file "cache/3basic_OLT.cfg";
>         option docsis.tftp-servers 2001:428:XXXX:100:172:19:0:200;
>         option docsis.time-servers 2001:428:XXXX:100:172:19:0:200;
>         on commit {
>                 execute("/etc/dhcp/htprov_defaultolt.sh", configfile);
>         }
> }
>
> I added the log entries to confirm that the data was correctly calculated and it works:
> Oct 30 05:55:01 hus-provserver dhcpd[3162636]: Sending config...
> Oct 30 05:55:01 hus-provserver dhcpd[3162636]: Sending config file f8345a7e48e2.cfg to device f8345a7e48e2
>
> But in the packet trace, the config file field is always missing
> Vendor-specific Information
>     Option: Vendor-specific Information (17)
>     Length: 52
>     Enterprise ID: Cable Television Laboratories, Inc. (4491)
>     Suboption: TFTP Server Addresses :  (32)
>         2001:428:XXXX:100:172:19:0:200
>     Suboption: Time Protocol Servers :  (37)
>         2001:428:XXXX:100:172:19:0:200
>     Suboption: Time Offset =  (38)-24200
>
> When I comment out the dynamic filename and enable the static one
>         #option docsis.configuration-file = concat("cache/ONU-", configfile);
>         option docsis.configuration-file "cache/3basic_OLT.cfg";
>
> Then the static name is sent as expected:
> Vendor-specific Information
>     Option: Vendor-specific Information (17)
>     Length: 76
>     Enterprise ID: Cable Television Laboratories, Inc. (4491)
>     Suboption: TFTP Server Addresses :  (32)
>         2001:428:XXXX:100:172:19:0:200
>     Suboption: Configuration File Name =  (33)"cache/3basic_OLT.cfg"
>     Suboption: Time Protocol Servers :  (37)
>         2001:428:XXXX:100:172:19:0:200
>     Suboption: Time Offset =  (38)-24200
>
> Would anybody have a possible pointer at what I'm doing wrong?
>
> Thanks
>
> Dave M.
>
> --
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users


More information about the dhcp-users mailing list