@@ -1670,22 +1670,18 @@ def configureNetworking(mounts, admin_iface, admin_bridge, admin_config, hn_conf
16701670 # now we need to write /etc/sysconfig/network
16711671 nfd = open ("%s/etc/sysconfig/network" % mounts ["root" ], "w" )
16721672 nfd .write ("NETWORKING=yes\n " )
1673+ ipv6_conf = open ("%s/etc/sysctl.d/91-net-ipv6.conf" % mounts ["root" ], "w" )
16731674 if admin_config .modev6 :
16741675 nfd .write ("NETWORKING_IPV6=yes\n " )
16751676 util .runCmd2 (['chroot' , mounts ['root' ], 'systemctl' , 'enable' , 'ip6tables' ])
16761677 for i in ['all' , 'default' ]:
1677- util .runCmd2 (
1678- ['chroot' , mounts ['root' ], 'sed' , '-i' , ('/^%s /s/=.*$/= 0/' % ('net.ipv6.conf.%s.disable_ipv6' % i )),
1679- "/etc/sysctl.d/90-net.conf" ]
1680- )
1678+ ipv6_conf .write ('net.ipv6.conf.%s.disable_ipv6=0' )
16811679 else :
16821680 nfd .write ("NETWORKING_IPV6=no\n " )
16831681 for i in ['all' , 'default' ]:
1684- util .runCmd2 (
1685- ['chroot' , mounts ['root' ], 'sed' , '-i' , ('/^%s /s/=.*$/= 1/' % ('net.ipv6.conf.%s.disable_ipv6' % i )),
1686- "/etc/sysctl.d/90-net.conf" ]
1687- )
1682+ ipv6_conf .write ('net.ipv6.conf.%s.disable_ipv6=1' )
16881683 netutil .disable_ipv6_module (mounts ["root" ])
1684+ ipv6_conf .close ()
16891685 nfd .write ("IPV6_AUTOCONF=no\n " )
16901686 nfd .write ('NTPSERVERARGS="iburst prefer"\n ' )
16911687 nfd .close ()
0 commit comments