diff options
author | Shraddha Pandhe <shraddha.pandhe@yahoo.com> | 2014-11-21 18:32:30 +0000 |
---|---|---|
committer | Shraddha Pandhe <shraddha.pandhe@yahoo.com> | 2014-11-21 18:32:30 +0000 |
commit | bfbe8099b98bb97cfd96385fe31c023548734cbf (patch) | |
tree | 64763abe1f4ac33d58365f3d6b2bc68d2861c290 /cloudinit/distros/rhel.py | |
parent | 3efc7142a6ca72bfb40e63c49ed64e2e04837c51 (diff) | |
download | vyos-cloud-init-bfbe8099b98bb97cfd96385fe31c023548734cbf.tar.gz vyos-cloud-init-bfbe8099b98bb97cfd96385fe31c023548734cbf.zip |
Add IPv6 Support for Rhel.
This patch does the following:
1. Adds support to process network config with IPv6
2. Adds support to display 'ifconfig -a' information for IPv6
3. Adds support to display routing information for IPv6
Diffstat (limited to 'cloudinit/distros/rhel.py')
-rw-r--r-- | cloudinit/distros/rhel.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py index 1a269e08..fa3ccb38 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,9 @@ 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) rhel_util.update_sysconfig_file(self.network_conf_fn, net_cfg) return dev_names |