summaryrefslogtreecommitdiff
path: root/cloudinit/distros/rhel.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-11-24 16:30:00 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-11-24 16:30:00 -0800
commit033eb26e698ebe6d003732ac4a64cefbdbf45f4e (patch)
tree5e4557300b72e7a2f3aaef3c7450eae47edb36a2 /cloudinit/distros/rhel.py
parent17fef56ab4d1235fb08cae824139b2a7cb6801f4 (diff)
parenta2915dae58bb735a0033b3575db6540b8fee4a4e (diff)
downloadvyos-cloud-init-033eb26e698ebe6d003732ac4a64cefbdbf45f4e.tar.gz
vyos-cloud-init-033eb26e698ebe6d003732ac4a64cefbdbf45f4e.zip
IPv6 support for rhel distro
When the ubuntu networking info file has ipv6 addresses inside it we need to make sure that we parse that information out and place it (at least) in the rhel network configuration writing. In later patches the other distros that use this parsed network configuration will likely also need to be updated (ubuntu and debian already should function as expected with regard to ipv6 support).
Diffstat (limited to 'cloudinit/distros/rhel.py')
-rw-r--r--cloudinit/distros/rhel.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py
index 1a269e08..13335df5 100644
--- a/cloudinit/distros/rhel.py
+++ b/cloudinit/distros/rhel.py
@@ -71,6 +71,7 @@ class Distro(distros.Distro):
nameservers = []
searchservers = []
dev_names = entries.keys()
+ use_ipv6 = False
for (dev, info) in entries.iteritems():
net_fn = self.network_script_tpl % (dev)
net_cfg = {
@@ -83,6 +84,13 @@ class Distro(distros.Distro):
'MACADDR': info.get('hwaddress'),
'ONBOOT': _make_sysconfig_bool(info.get('auto')),
}
+ if info.get('inet6'):
+ use_ipv6 = True
+ net_cfg.update({
+ 'IPV6INIT': _make_sysconfig_bool(True),
+ 'IPV6ADDR': info.get('ipv6').get('address'),
+ 'IPV6_DEFAULTGW': info.get('ipv6').get('gateway'),
+ })
rhel_util.update_sysconfig_file(net_fn, net_cfg)
if 'dns-nameservers' in info:
nameservers.extend(info['dns-nameservers'])
@@ -95,6 +103,10 @@ class Distro(distros.Distro):
net_cfg = {
'NETWORKING': _make_sysconfig_bool(True),
}
+ # If IPv6 interface present, enable ipv6 networking
+ if use_ipv6:
+ net_cfg['NETWORKING_IPV6'] = _make_sysconfig_bool(True)
+ net_cfg['IPV6_AUTOCONF'] = _make_sysconfig_bool(False)
rhel_util.update_sysconfig_file(self.network_conf_fn, net_cfg)
return dev_names