Ubuntu server calls dhclient with a few flags, but mostly default options, and it therefore defaults to a type 1 DUID-LLT DUID. Ubuntu desktop uses Network Manager which then calls dhclient with a type 4 DUID-UUID DUID.
For servers, it puts it in /var/lib/dhcp/dhclient6.......lease
For desktop, it puts it in /var/lib/NetworkManager/dhclient6.......lease
It's a weird string that looks like:
default-duid "\000\001\000\001\037\305\371\341\001\002\003\004\005\006"
Here's a short script you can use to convert it to a normal hex format duid.
Just run the script like:
./script '\000\001\000\001\037\305\371\341\001\002\003\004\005\006'
The script:
#!/bin/bash
printf $1 | hexdump -e '14/1 "%02x " "\n"' | sed 's/ /:/g'
14/1to18/1in the script to account for the longer length of type 4 duid's. I think the script originally came from some redhat documentation and only had type 1 and type 3 duid's in mind. – Bryce Larson Feb 22 '17 at 07:57-s 2to skip some of the pre-amble, e.g.:
– Brian Redbeard Jul 09 '17 at 07:49hexdump -s 2 -e '14/1 "%02x " "\n"' /var/lib/dhcpv6/dhcp6c_duiddecode_lease_id () { local pat='^\\([0-9]{3})|.' input=$1; while [[ "$input" =~ $pat ]]; do if [[ "${BASH_REMATCH[1]}" ]]; then int=$(( 8#${BASH_REMATCH[1]} )); input=${input:4}; else int=\'${BASH_REMATCH[0]}; input=${input:1}; fi; printf '%02x' "$int"; if [[ "$input" ]]; then printf :; else printf '\n'; fi; done; }sodecode_lease_id '\000\004\354\352~\365\017\375\330\201!\230+<Oj\031\302'produces00:04:ec:ea:7e:f5:0f:fd:d8:81:21:98:2b:3c:4f:6a:19:c2. – Walf Feb 26 '25 at 07:46