Sending dynamic boot filename to clients

Dave M <[email protected]> Mon, 30 Oct 2023 08:09:30 -0400
Newsgroups gmane.network.dhcp.isc.dhcp-server
Message-ID <CACx_ihET9d5+PSuNohCJHRE=rJ3_c4ZaJ-Emi_aZpQ2V4ZOC7g@mail.gmail.com>
--===============7944461991721201412==
Content-Type: multipart/alternative; boundary="000000000000aff2750608ede99a"

--000000000000aff2750608ede99a
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.

--000000000000aff2750608ede99a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hello,</div><div><br></div><div>I&#39;m currently run=
ning version=C2=A0isc-dhcpd-4.4.1 on Ubuntu 20.04. I&#39;m planning to migr=
ate to Kea but having tried the configuration assistant left me with more q=
uestions than answers to I will need to manually build this config and it w=
ill be a month long project.</div><div><br></div><div>I&#39;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&#39;t get=
 it to work on IPv6. These are DOCSIS cable modems trying to boot and acqui=
re their config.</div><div><br></div><div>What I have setup is the followin=
g</div><div><br></div><div># declare the option space where the CableLabs o=
ptions live<br>option space docsis code width 2 length width 2 hash size 10=
0;<br>option docsis.tftp-servers code 32 =3D array of ip6-address;<br>optio=
n docsis.configuration-file code 33 =3D text;<br>option docsis.syslog-serve=
rs code 34 =3D array of ip6-address;<br>option docsis.time-servers code 37 =
=3D array of ip6-address;<br>option docsis.time-offset code 38 =3D signed i=
nteger 32;</div><div>option vsio.docsis code 4491 =3D encapsulate docsis;</=
div><div><br></div><div>subnet6 2001:428:XXXX:1300::/64 {<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 range6 2001:428:XXXX:1300::ff01 2001:428:XXXX:1300::ffff;<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 set hw_mac_short =3D concat (<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 suffix(concat(&quot;0&quot;, binary-to-a=
scii (16, 8, &quot;&quot;, substring(suffix(option dhcp6.client-id, 6),0,1)=
)),2),<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 suffix(concat(&q=
uot;0&quot;, binary-to-ascii (16, 8, &quot;&quot;, substring(suffix(option =
dhcp6.client-id, 6),1,1))),2),<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 suffix(concat(&quot;0&quot;, binary-to-ascii (16, 8, &quot;&quot;, =
substring(suffix(option dhcp6.client-id, 6),2,1))),2),<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 suffix(concat(&quot;0&quot;, binary-to-asci=
i (16, 8, &quot;&quot;, substring(suffix(option dhcp6.client-id, 6),3,1))),=
2),<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 suffix(concat(&quot=
;0&quot;, binary-to-ascii (16, 8, &quot;&quot;, substring(suffix(option dhc=
p6.client-id, 6),4,1))),2),<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 suffix(concat(&quot;0&quot;, binary-to-ascii (16, 8, &quot;&quot;, s=
ubstring(suffix(option dhcp6.client-id, 6),5,1))),2)<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 );<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 set confi=
gfile =3D concat(hw_mac_short, &quot;.cfg&quot;);<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 log (info, &quot;Sending config...&quot;);<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 log (info, concat (&quot;Sending config file &quot;, configfile, &qu=
ot; to device &quot;, hw_mac_short));<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 option=
 dhcp6.domain-search &quot;<a href=3D"http://cm.den.company.com">cm.den.com=
pany.com</a>&quot;;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 option docsis.time-offse=
t -24200;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 option docsis.configuration-file =
=3D concat(&quot;cache/ONU-&quot;, configfile);<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 #option docsis.configuration-file &quot;cache/3basic_OLT.cfg&quot;;<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 option docsis.tftp-servers 2001:428:XXXX:100:17=
2:19:0:200;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 option docsis.time-servers 2001:=
428:XXXX:100:172:19:0:200;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 on commit {<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 execute(&quot;/etc/=
dhcp/htprov_defaultolt.sh&quot;, configfile);<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 }<br>}</div><div><br></div><div>I added the log entries to confirm that=
 the data was correctly calculated and it works:</div><div>Oct 30 05:55:01 =
hus-provserver dhcpd[3162636]: Sending config...<br>Oct 30 05:55:01 hus-pro=
vserver dhcpd[3162636]: Sending config file f8345a7e48e2.cfg to device f834=
5a7e48e2</div><div><br></div><div>But in the packet trace, the config file =
field is always missing</div><div><div>Vendor-specific Information<br>=C2=
=A0 =C2=A0 Option: Vendor-specific Information (17)<br>=C2=A0 =C2=A0 Length=
: 52<br>=C2=A0 =C2=A0 Enterprise ID: Cable Television Laboratories, Inc. (4=
491)<br>=C2=A0 =C2=A0 Suboption: TFTP Server Addresses : =C2=A0(32)</div><d=
iv>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2001:428:XXXX:100:172:19:0:20=
0<br>=C2=A0 =C2=A0 Suboption: Time Protocol Servers : =C2=A0(37)</div><div>=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2001:428:XXXX:100:172:19:0:200</=
div><div>=C2=A0 =C2=A0 Suboption: Time Offset =3D =C2=A0(38)-24200</div></d=
iv><div><br></div><div>When I comment out the dynamic filename and enable t=
he static one</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 #option docsis.configur=
ation-file =3D concat(&quot;cache/ONU-&quot;, configfile);<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 option docsis.configuration-file &quot;cache/3basic_OLT.cfg&=
quot;;</div><div><br></div><div>Then the static name is sent as expected:</=
div><div>Vendor-specific Information<br>=C2=A0 =C2=A0 Option: Vendor-specif=
ic Information (17)<br>=C2=A0 =C2=A0 Length: 76<br>=C2=A0 =C2=A0 Enterprise=
 ID: Cable Television Laboratories, Inc. (4491)<br>=C2=A0 =C2=A0 Suboption:=
 TFTP Server Addresses : =C2=A0(32)</div><div>=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 2001:428:XXXX:100:172:19:0:200<br></div><div>=C2=A0 =C2=A0 =
Suboption: Configuration File Name =3D =C2=A0(33)&quot;cache/3basic_OLT.cfg=
&quot;<br>=C2=A0 =C2=A0 Suboption: Time Protocol Servers : =C2=A0(37)</div>=
<div>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2001:428:XXXX:100:172:19:0:=
200</div><div>=C2=A0 =C2=A0 Suboption: Time Offset =3D =C2=A0(38)-24200</di=
v><div><br></div><div>Would anybody have a possible pointer at what I&#39;m=
 doing wrong?</div><div><br></div><div>Thanks</div><div><br></div><div>Dave=
 M.<br></div><div><br></div></div>

--000000000000aff2750608ede99a--

--===============7944461991721201412==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
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
[email protected]
https://lists.isc.org/mailman/listinfo/dhcp-users

--===============7944461991721201412==--