Send dhcp-users mailing list submissions to
        dhcp-users@lists.isc.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/dhcp-users
or, via email, send a message with subject or body 'help' to
        dhcp-users-requ...@lists.isc.org

You can reach the person managing the list at
        dhcp-users-ow...@lists.isc.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."


Today's Topics:

   1. Sending dynamic boot filename to clients (Dave M)
   2. Re: Sending dynamic boot filename to clients (Darren Ankney)


----------------------------------------------------------------------

Message: 1
Date: Mon, 30 Oct 2023 08:09:30 -0400
From: Dave M <2wheels...@gmail.com>
To: dhcp-users@lists.isc.org
Subject: Sending dynamic boot filename to clients
Message-ID:
        <CACx_ihET9d5+PSuNohCJHRE=rj3_c4zaj-emi_azpq2v4zo...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/dhcp-users/attachments/20231030/a63139d0/attachment-0001.htm>

------------------------------

Message: 2
Date: Mon, 30 Oct 2023 13:57:36 +0100
From: Darren Ankney <darren.ank...@gmail.com>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Sending dynamic boot filename to clients
Message-ID:
        <CAKabWHjuZJFs1184k5xPUgGPMmC2X-_0Yhws4p9=sbmm6kc...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

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 <2wheels...@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@lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users


------------------------------

Subject: Digest Footer

_______________________________________________
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@lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users


------------------------------

End of dhcp-users Digest, Vol 179, Issue 1
******************************************

Reply via email to