How to use --ipv6_ra_mode dhcpv6-stateless --ipv6_address_mode dhcpv6-stateless?

asked 2017-06-06 07:32:24 -0600

correajl gravatar image

updated 2017-06-07 07:01:03 -0600

My environment has subnets configured with:

--ipv6_ra_mode dhcpv6-stateless --ipv6_address_mode dhcpv6-stateless

Addresses are well generated (slaac) and VMs have connectivity. But, dhcpv6 requests are not sent. I need that VMs request other information (like nameservers) from dhcpv6 on boot. I've tested manually after boot and it works.

I've seen that the file /etc/network/interfaces.d/50-cloud-init.cfg is generated at boot time. Its content is:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback

auto ens3
iface ens3 inet dhcp

To do what I'm thinking I just need to put these other lines in this configuration file:

iface ens3 inet6 auto
  pre-up sleep 5
  dhcp 1

This was tested, running dhcpv6 manually. Sleep 5 is due a Ubuntu bug and 'dhcp 1' indicates that information should be obtained from dhcpv6 server.

Anyone could suggest how can I get this configuration?

Remenbering that the name of interface is generated by the VMs. For example, in Ubuntu we have ens3 and in Debian eth0. So, bash scripts as user_data to write the interfaces file doesn't looks like a good solution.

I had hope cloud-init could do that.


edit retag flag offensive close merge delete


Thanks for mentioning the "dhcp 1" option, I didn't know that before. Otherwise I agree that this would be a useful feature for cloud-init, probably best create a bug report for it at in order to reach the developers.

j-harbott gravatar imagej-harbott ( 2017-07-12 04:05:12 -0600 )edit