<div dir="ltr"><br><div class="gmail_quote"><br><div dir="ltr"><div><div><div><div>Hello,<br><br></div>I am running isc-dhcpd 4.2.3 on Ubuntu Trusty, I want to use it to provide ipv6 addresses based on the serial number of the system.<br></div>The serial number of the system in in dhcp6.client-id and read like this<br>00:02:00:00:00:09:46:4f:43:31:39:34:37:52:31:34:33:00 with the serial number being FOC1947R143<br></div>In order to provide the iPXE bootfile I configure the host section like this<br><br>host ncs-5001-b {<br>       host-identifier option dhcp6.client-id 00:02:00:00:00:09:46:4f:43:31:39:34:37:52:31:34:33:00;<br>       if exists dhcp6.user-class and substring(option dhcp6.user-class, 2, 4) = "iPXE" {<br>           option dhcp6.bootfile-url = "http://[fd:30::172:30:0:22]/ncs5k-mini-2.iso";<br>       }<br>       fixed-address6 fd:30:12::172.30.12.52;<br>}<br><br></div>This works perfectly but I would like to have the serial number as a string so I did this<br><br>option dhcp6.serial-number code 9999 = string; <br>option dhcp6.serial-number = substring(option dhcp6.client-id, 6, 11);<br><br><div>host ncs-5001-b {<br>            host-identifier option dhcp6.serial-number "FOC1947R143";<br>            if exists dhcp6.user-class and substring(option dhcp6.user-class, 2, 4) = "iPXE" {<br>                option dhcp6.bootfile-url = "http://[fd:30::172:30:0:22]/ncs5k-mini-2";<br>            }<br>            fixed-address6 fd:30:12::172.30.12.52;<br>}<br><br></div><div>But this does not work because my understanding is that only options passed by the client can be used for the host-identifier.<br></div><div>What would be the correct way to have a host id based only on the string of the serial number ?<br><br></div><div>Thank you for your time<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>/Patrick<br></div><div><br></div></font></span></div>
</div><br></div>