Skip to content

Commit 9566c5d

Browse files
authored
Merge pull request #5686 from xcp-ng/gtn-dont-generate-link-local-address
2 parents 231b94d + acf6b96 commit 9566c5d

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

scripts/xe-enable-ipv6

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,19 @@ if [ $1 = "enable" ]; then
3030
echo "IPV6_AUTOCONF=NO" >> /etc/sysconfig/network
3131
chkconfig ip6tables on
3232

33-
echo "net.ipv6.conf.all.disable_ipv6=0" > /etc/sysctl.d/91-net-ipv6.conf
34-
echo "net.ipv6.conf.default.disable_ipv6=0" >> /etc/sysctl.d/91-net-ipv6.conf
33+
cat > /etc/sysctl.d/91-net-ipv6.conf <<- EOF
34+
net.ipv6.conf.all.disable_ipv6=0
35+
net.ipv6.conf.default.disable_ipv6=0
36+
37+
# Defines how link-local and autoconf addresses are generated.
38+
# A value of 1 does the following:
39+
# - do not generate a link-local address
40+
# - use EUI64 for addresses generated from autoconf
41+
# "all" only affects the current state of all interfaces
42+
# "default" affect all interfaces that are created in the future
43+
net.ipv6.conf.all.addr_gen_mode=1
44+
net.ipv6.conf.default.addr_gen_mode=1
45+
EOF
3546

3647
echo "IPv6 enabled. You may now need to reboot the host"
3748
elif [ $1 = "disable" ]; then
@@ -49,8 +60,10 @@ elif [ $1 = "disable" ]; then
4960
echo "NETWORKING_IPV6=NO" >> /etc/sysconfig/network
5061
echo "IPV6_AUTOCONF=NO" >> /etc/sysconfig/network
5162

52-
echo "net.ipv6.conf.all.disable_ipv6=1" > /etc/sysctl.d/91-net-ipv6.conf
53-
echo "net.ipv6.conf.default.disable_ipv6=1" >> /etc/sysctl.d/91-net-ipv6.conf
63+
cat > /etc/sysctl.d/91-net-ipv6.conf <<- EOF
64+
net.ipv6.conf.all.disable_ipv6=1
65+
net.ipv6.conf.default.disable_ipv6=1
66+
EOF
5467

5568
echo "IPv6 disabled. You may now need to reboot the host"
5669
else

0 commit comments

Comments
 (0)