File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
test/kickstart-templates/includes Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -17,3 +17,24 @@ find /etc/NetworkManager -name '*.nmconnection' -print0 | while IFS= read -r -d
17
17
sed -i ' s/method=.*/method=auto/g' " ${file}"
18
18
fi
19
19
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 installation is saved and
27
+ # configured in NetworkManager to use it when the system boots into the OS.
28
+ # The DUID is unique per host, and is extracted from the DHCP6 options of the active connections
29
+ # from NetworkManager.
30
+ DUID =$(nmcli con show --active | \
31
+ awk ' {print $1}' | \
32
+ grep -v NAME | \
33
+ xargs nmcli --fields DHCP6.OPTION con show | \
34
+ grep dhcp6_client_id | \
35
+ awk ' {print $4}' | \
36
+ uniq)
37
+ if [ -n " $DUID" ]; then
38
+ mkdir -p /etc/NetworkManager/conf.d/
39
+ echo -e " [connection]\nipv6.dhcp-duid=$DUID" > /etc/NetworkManager/conf.d/dhcp-client.conf
40
+ fi
You can’t perform that action at this time.
0 commit comments