Displaying 1 result from an estimated 1 matches for "machine_id_sha256".
2016 Jul 27
0
How to convert /etc/machine-id into a default-duid for IPv6 static DHCP?
...ses MAC addresses for static DHCP.
How does one convert /etc/machine-id to a default-duid (in bash)?
1) /etc/machine-id -> DUID:
<read RFC6355 and try to grasp the NetworkManager code at [0] & [1]>
Use sha256 hash of machine-id, use first 128 bits, add colons and
prepend 00:04:
$ MACHINE_ID_SHA256=`cat /etc/machine_id | sha256sum | cut -c1-32`
$ TMPID=$(sed -e 's/.\{2\}/&:/g;s/.$//' <<<$MACHINE_ID_SHA256)
$ DUID=00:04:`echo $TMPID`
Correct?
2) convert $DUID to a default-duid. Example value of default-duid can be
found in /var/lib/NetworkManager/dhclient6-<string>...