Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/kickstart-templates/includes/post-network.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,18 @@ find /etc/NetworkManager -name '*.nmconnection' -print0 | while IFS= read -r -d
sed -i 's/method=.*/method=auto/g' "${file}"
fi
done

# IPv6 only feature. An IPv6 VM will use DHCPv6 to get an IP address. To identify itself to a DHCP
# server it uses something called DHCP Unique Identifier (DUID), and based on that the DHCP server
# will issue a lease for that DUID and MAC address. When the system boots into anaconda to install
# the OS with kickstart files, the DUID is automatically generated. After the system boots into the
# OS a new DUID may be generated, causing DHCP to identify the VM as a new system, thus allocating
# a new IP address. In order to avoid this, the DUID generated during the installarion is saved and
# configured in NetworkManager to use it when the system boots into the OS.
# The DUID is extracted from the journal logs to avoid pinning to a specific NIC name (which would
# use nmcli commands).
DUID=$(journalctl -u NetworkManager | grep duid | grep -Eo "([0-9a-f]{2}:){17}[0-9a-f]{2}" | uniq)
if [ -n "$DUID" ]; then
mkdir -p /etc/NetworkManager/conf.d/
echo -e "[connection]\nipv6.dhcp-duid=$DUID" > /etc/NetworkManager/conf.d/dhcp-client.conf
fi