summaryrefslogtreecommitdiff
path: root/cloudinit/net
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2017-06-15 15:09:17 -0500
committerScott Moser <smoser@brickies.net>2017-07-20 16:47:12 -0400
commit353c6902fb94899d410eb2f8bcc0bb81916e0e9e (patch)
tree323c2afc0b7ca1492917391f5d05e42ee1db588b /cloudinit/net
parent8317bcab7cd08f1dcd96095c0cb746b57cb27234 (diff)
downloadvyos-cloud-init-353c6902fb94899d410eb2f8bcc0bb81916e0e9e.tar.gz
vyos-cloud-init-353c6902fb94899d410eb2f8bcc0bb81916e0e9e.zip
sysconfig: enable mtu set per subnet, including ipv6 mtu
Render MTU values if present in subnet and route configurations for v4 and v6. LP: #1702513
Diffstat (limited to 'cloudinit/net')
-rw-r--r--cloudinit/net/sysconfig.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index b0f2ccf5..c7df36c0 100644
--- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py
@@ -273,6 +273,7 @@ class Renderer(renderer.Renderer):
# modifying base values according to subnets
for i, subnet in enumerate(subnets, start=len(iface_cfg.children)):
+ mtu_key = 'MTU'
subnet_type = subnet.get('type')
if subnet_type == 'dhcp6':
iface_cfg['IPV6INIT'] = True
@@ -292,7 +293,11 @@ class Renderer(renderer.Renderer):
# if iface_cfg['BOOTPROTO'] == 'none':
# iface_cfg['BOOTPROTO'] = 'static'
if subnet_is_ipv6(subnet):
+ mtu_key = 'IPV6_MTU'
iface_cfg['IPV6INIT'] = True
+
+ if 'mtu' in subnet:
+ iface_cfg[mtu_key] = subnet['mtu']
else:
raise ValueError("Unknown subnet type '%s' found"
" for interface '%s'" % (subnet_type,