summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorRobert Schweikert <rjschwei@suse.com>2019-03-25 15:53:12 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-03-25 15:53:12 +0000
commitbb0b6f1d4e587d74a6e8fe17fa1c4dc3cf5287f7 (patch)
tree934fd50d3bd4a538420d97265cead4521c42a27e /cloudinit
parentdfe50e300882e3affcb02e686578807aea921b99 (diff)
downloadvyos-cloud-init-bb0b6f1d4e587d74a6e8fe17fa1c4dc3cf5287f7.tar.gz
vyos-cloud-init-bb0b6f1d4e587d74a6e8fe17fa1c4dc3cf5287f7.zip
net/sysconfig: write out SUSE-compatible IPv6 config
For writing IPv6 addresses to ifcfg-* the name "IPV6ADDR" is used. For secondary IPs the value for "IPV6ADDR_SECONDARIES" is set. On SUSE based distributions the names "IPADDR6" and "IPADDR6_$SOMELABEL" need to be used.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/net/sysconfig.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index e59753d5..09983929 100644
--- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py
@@ -386,10 +386,13 @@ class Renderer(renderer.Renderer):
ipv6_cidr = "%s/%s" % (subnet['address'], subnet['prefix'])
if ipv6_index == 0:
iface_cfg['IPV6ADDR'] = ipv6_cidr
+ iface_cfg['IPADDR6'] = ipv6_cidr
elif ipv6_index == 1:
iface_cfg['IPV6ADDR_SECONDARIES'] = ipv6_cidr
+ iface_cfg['IPADDR6_0'] = ipv6_cidr
else:
iface_cfg['IPV6ADDR_SECONDARIES'] += " " + ipv6_cidr
+ iface_cfg['IPADDR6_%d' % ipv6_index] = ipv6_cidr
else:
ipv4_index = ipv4_index + 1
suff = "" if ipv4_index == 0 else str(ipv4_index)