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