@@ -30,8 +30,19 @@ if [ $1 = "enable" ]; then
30
30
echo " IPV6_AUTOCONF=NO" >> /etc/sysconfig/network
31
31
chkconfig ip6tables on
32
32
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
35
46
36
47
echo " IPv6 enabled. You may now need to reboot the host"
37
48
elif [ $1 = " disable" ]; then
@@ -49,8 +60,10 @@ elif [ $1 = "disable" ]; then
49
60
echo " NETWORKING_IPV6=NO" >> /etc/sysconfig/network
50
61
echo " IPV6_AUTOCONF=NO" >> /etc/sysconfig/network
51
62
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
54
67
55
68
echo " IPv6 disabled. You may now need to reboot the host"
56
69
else
0 commit comments