Skip to content

Commit

Permalink
Merge pull request #5686 from xcp-ng/gtn-dont-generate-link-local-add…
Browse files Browse the repository at this point in the history
…ress
  • Loading branch information
psafont authored Jun 25, 2024
2 parents 231b94d + acf6b96 commit 9566c5d
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions scripts/xe-enable-ipv6
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,19 @@ if [ $1 = "enable" ]; then
echo "IPV6_AUTOCONF=NO" >> /etc/sysconfig/network
chkconfig ip6tables on

echo "net.ipv6.conf.all.disable_ipv6=0" > /etc/sysctl.d/91-net-ipv6.conf
echo "net.ipv6.conf.default.disable_ipv6=0" >> /etc/sysctl.d/91-net-ipv6.conf
cat > /etc/sysctl.d/91-net-ipv6.conf <<- EOF
net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.default.disable_ipv6=0
# Defines how link-local and autoconf addresses are generated.
# A value of 1 does the following:
# - do not generate a link-local address
# - use EUI64 for addresses generated from autoconf
# "all" only affects the current state of all interfaces
# "default" affect all interfaces that are created in the future
net.ipv6.conf.all.addr_gen_mode=1
net.ipv6.conf.default.addr_gen_mode=1
EOF

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

echo "net.ipv6.conf.all.disable_ipv6=1" > /etc/sysctl.d/91-net-ipv6.conf
echo "net.ipv6.conf.default.disable_ipv6=1" >> /etc/sysctl.d/91-net-ipv6.conf
cat > /etc/sysctl.d/91-net-ipv6.conf <<- EOF
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
EOF

echo "IPv6 disabled. You may now need to reboot the host"
else
Expand Down

0 comments on commit 9566c5d

Please sign in to comment.