Merge ~yadle/cloud-init:fix-ipv6-configuration into cloud-init:master
Status: | Work in progress |
---|---|
Proposed branch: | ~yadle/cloud-init:fix-ipv6-configuration |
Merge into: | cloud-init:master |
Diff against target: |
66 lines (+30/-1) 2 files modified
cloudinit/net/eni.py (+2/-0) tests/unittests/test_distros/test_netconfig.py (+28/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ryan Harper | Needs Fixing | ||
Server Team CI bot | continuous-integration | Needs Fixing | |
Review via email: mp+362005@code.launchpad.net |
Commit message
Nocloud v1 config passes static6 as the type of subnet. This patch replaces static6 by static during interfaces file generation as static6 is not a valid keyword in /etc/network/
Description of the change
nocloud v1 network-config looks like this:
version: 1
config:
- type: physical
name: eth0
mac_address: b2:b8:6e:6f:58:47
subnets:
- type: static
address: <ipv4 addr>
netmask: 255.255.255.224
gateway: <ipv4 gw addr>
- type: static6
address: <ipv6 addr>
gateway: <ipv6 gw addr>
...
Without the patch this leads to that kind of file:
/etc/network/
<snip>
auto eth0
iface eth0 inet static
address <ipv4 addr>
gateway <ipv4 gw addr>
# control-alias eth0
iface eth0 inet6 static6
address <ipv6 addr>
gateway <ipv6 gw addr>
<snip>
Which is not valid, at least in ubuntu xenial. With the patch we get the right entry for ipv6 configuration:
# control-alias eth0
iface eth0 inet6 static <<<---- 6 removed here
address <ipv6 addr>
gateway <ipv6 gw addr>
Yes, that's a good catch. I can reproduce this and ifupdown produces this output:
/etc/network/ interfaces. d/50-cloud- init.cfg: 13: unknown or no method and no inherits keyword specified interfaces. d/50-cloud- init.cfg: 13: unknown or no method and no inherits keyword specified interfaces. d/50-cloud- init.cfg: 13: unknown or no method and no inherits keyword specified
/etc/network/
/etc/network/
And removing the '6' from static resolves it.