Re: [Cloud-init-dev] [Merge] ~raharper/cloud-init:fix/netplan-accept-ra-off into cloud-init:master
If anything, this is fallout due to the bug you mention. LXD should be explicit; as should cloud-init. On Mon, Feb 26, 2018 at 10:07 AM, Scott Moserwrote: > So this *will* cause a change in behavior in all lxd guests. > > $ lxd file pull b1/var/lib/cloud/seed/nocloud-net/network-config - > version: 1 > config: > - type: physical > name: eth0 > subnets: > - type: dhcp > control: auto > > > nothing there says we *should* have ipv6, yet I do have ipv6 enabled. > > $ lxc network show lxdbr0 > config: > ipv4.address: 10.145.210.1/24 > ipv4.nat: "true" > ipv6.address: fd42:6470:c1cd:249f::1/64 > ipv6.nat: "true" > description: "" > name: lxdbr0 > type: bridge > used_by: > - /1.0/containers/a1 > - /1.0/containers/b1 > - /1.0/containers/b2 > - /1.0/containers/bb > - /1.0/containers/x1 > managed: true > > $ lxc list | grep b1 > | b1 | RUNNING | 10.145.210.39 (eth0) | > fd42:6470:c1cd:249f:216:3eff:fe95:9c7c > (eth0) | PERSISTENT | 0 | > > > Related bugs > https://bugs.launchpad.net/ubuntu/+source/nplan/+bug/1732002 > > -- > https://code.launchpad.net/~raharper/cloud-init/+git/ > cloud-init/+merge/339437 > You are the owner of ~raharper/cloud-init:fix/netplan-accept-ra-off. > -- https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/339437 Your team cloud-init commiters is requested to review the proposed merge of ~raharper/cloud-init:fix/netplan-accept-ra-off into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~raharper/cloud-init:fix/netplan-accept-ra-off into cloud-init:master
So this *will* cause a change in behavior in all lxd guests. $ lxd file pull b1/var/lib/cloud/seed/nocloud-net/network-config - version: 1 config: - type: physical name: eth0 subnets: - type: dhcp control: auto nothing there says we *should* have ipv6, yet I do have ipv6 enabled. $ lxc network show lxdbr0 config: ipv4.address: 10.145.210.1/24 ipv4.nat: "true" ipv6.address: fd42:6470:c1cd:249f::1/64 ipv6.nat: "true" description: "" name: lxdbr0 type: bridge used_by: - /1.0/containers/a1 - /1.0/containers/b1 - /1.0/containers/b2 - /1.0/containers/bb - /1.0/containers/x1 managed: true $ lxc list | grep b1 | b1 | RUNNING | 10.145.210.39 (eth0) | fd42:6470:c1cd:249f:216:3eff:fe95:9c7c (eth0) | PERSISTENT | 0 | Related bugs https://bugs.launchpad.net/ubuntu/+source/nplan/+bug/1732002 -- https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/339437 Your team cloud-init commiters is requested to review the proposed merge of ~raharper/cloud-init:fix/netplan-accept-ra-off into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~raharper/cloud-init:fix/netplan-accept-ra-off into cloud-init:master
Review: Approve continuous-integration PASSED: Continuous integration, rev:f59bca50f8c24f18a892f937ec18c3bb640baf01 https://jenkins.ubuntu.com/server/job/cloud-init-ci/788/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration SUCCESS: MAAS Compatability Testing IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/788/rebuild -- https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/339437 Your team cloud-init commiters is requested to review the proposed merge of ~raharper/cloud-init:fix/netplan-accept-ra-off into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~raharper/cloud-init:fix/netplan-accept-ra-off into cloud-init:master
Ryan Harper has proposed merging ~raharper/cloud-init:fix/netplan-accept-ra-off into cloud-init:master. Requested reviews: cloud-init commiters (cloud-init-dev) For more details, see: https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/339437 netplan: disable IPV6 RA mode unless configuring ipv6 On distros using netplan and systemd-networkd the default configuration is to enable solicitation of of IPV6 Router Advertisments. This incurs a significant delay during boot, approximately 10 seconds if the network does not contain any IPV6 routers. If the network configuration that cloud-init renders is not explicitly configuring IPV6, then disable IPV6 RA on the interfaces in the configuration. -- Your team cloud-init commiters is requested to review the proposed merge of ~raharper/cloud-init:fix/netplan-accept-ra-off into cloud-init:master. diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py index d3788af..dc33a47 100644 --- a/cloudinit/net/netplan.py +++ b/cloudinit/net/netplan.py @@ -92,6 +92,10 @@ def _extract_addresses(config, entry): if sn_type == 'dhcp': sn_type += '4' entry.update({sn_type: True}) +if sn_type == 'dhcp6': +entry.update({'accept-ra': True}) +else: +entry.update({'accept-ra': False}) elif sn_type in ['static']: addr = "%s" % subnet.get('address') if 'prefix' in subnet: @@ -102,6 +106,10 @@ def _extract_addresses(config, entry): entry.update({'gateway6': gateway}) else: entry.update({'gateway4': gateway}) +if ':' in addr: +entry.update({'accept-ra': True}) +else: +entry.update({'accept-ra': False}) if 'dns_nameservers' in subnet: nameservers += _listify(subnet.get('dns_nameservers', [])) if 'dns_search' in subnet: diff --git a/tests/unittests/test_distros/test_netconfig.py b/tests/unittests/test_distros/test_netconfig.py index 1c2e45f..e9105f1 100644 --- a/tests/unittests/test_distros/test_netconfig.py +++ b/tests/unittests/test_distros/test_netconfig.py @@ -126,19 +126,23 @@ network: version: 2 ethernets: eth0: +accept-ra: false addresses: - 192.168.1.5/24 gateway4: 192.168.1.254 eth1: +accept-ra: false dhcp4: true """ V2_NET_CFG = { 'ethernets': { 'eth7': { +'accept-ra': False, 'addresses': ['192.168.1.5/24'], 'gateway4': '192.168.1.254'}, 'eth9': { +'accept-ra': True, 'dhcp4': True} }, 'version': 2 @@ -154,10 +158,12 @@ V2_TO_V2_NET_CFG_OUTPUT = """ network: ethernets: eth7: +accept-ra: false addresses: - 192.168.1.5/24 gateway4: 192.168.1.254 eth9: +accept-ra: true dhcp4: true version: 2 """ diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py index ac33e8e..de082cb 100644 --- a/tests/unittests/test_net.py +++ b/tests/unittests/test_net.py @@ -403,6 +403,7 @@ NETWORK_CONFIGS = { - wark.maas set-name: eth1 eth99: +accept-ra: false addresses: - 192.168.21.3/24 dhcp4: true @@ -495,6 +496,7 @@ NETWORK_CONFIGS = { version: 2 ethernets: iface0: +accept-ra: true dhcp4: true dhcp6: true """).rstrip(' '), @@ -528,6 +530,7 @@ NETWORK_CONFIGS = { version: 2 ethernets: iface0: +accept-ra: true addresses: - 192.168.14.2/24 - 2001:1::1/64 @@ -719,6 +722,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true - foobar.maas set-name: eth4 eth5: +accept-ra: false dhcp4: true match: macaddress: 98:bb:9f:2c:e8:8a @@ -734,6 +738,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true set-name: eth5 bonds: bond0: +accept-ra: true dhcp6: true interfaces: - eth1 @@ -744,6 +749,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true transmit-hash-policy: