Skip to content

Commit 379add1

Browse files
committed
USHIFT-5402: Handle DUID in ipv6 test harness
1 parent 6c42350 commit 379add1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/kickstart-templates/includes/post-network.cfg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,18 @@ find /etc/NetworkManager -name '*.nmconnection' -print0 | while IFS= read -r -d
1717
sed -i 's/method=.*/method=auto/g' "${file}"
1818
fi
1919
done
20+
21+
# IPv6 only feature. An IPv6 VM will use DHCPv6 to get an IP address. To identify itself to a DHCP
22+
# server it uses something called DHCP Unique Identifier (DUID), and based on that the DHCP server
23+
# will issue a lease for that DUID and MAC address. When the system boots into anaconda to install
24+
# the OS with kickstart files, the DUID is automatically generated. After the system boots into the
25+
# OS a new DUID may be generated, causing DHCP to identify the VM as a new system, thus allocating
26+
# a new IP address. In order to avoid this, the DUID generated during the installarion is saved and
27+
# configured in NetworkManager to use it when the system boots into the OS.
28+
# The DUID is extracted from the journal logs to avoid pinning to a specific NIC name (which would
29+
# use nmcli commands).
30+
DUID=$(journalctl -u NetworkManager | grep duid | grep -Eo "([0-9a-f]{2}:){17}[0-9a-f]{2}" | uniq)
31+
if [ -n "$DUID" ]; then
32+
mkdir -p /etc/NetworkManager/conf.d/
33+
echo -e "[connection]\nipv6.dhcp-duid=$DUID" > /etc/NetworkManager/conf.d/dhcp-client.conf
34+
fi

0 commit comments

Comments
 (0)