Cannot describe an IPv6-only SLAAC interface in yaml

Bug #1752211 reported by Daniel Axtens
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Netplan
Fix Released
Undecided
Unassigned

Bug Description

Say I have an interface I want to configure as IPv6-only, and I want the interface to be configured with SLAAC.

I tried to describe this interface like this:

network:
    version: 2
    ethernets:
        ens7:
            match:
                macaddress: 52:54:00:e7:a7:97

I don't want to set dhcp6, as that is described as being for stateful configuration, and I just want stateless auto-configuration via router advertisements.

However, this file doesn't work. If I reboot, the interface stays down:

$ ip a show ens7
3: ens7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 52:54:00:e7:a7:97 brd ff:ff:ff:ff:ff:ff

I think this is due to the way src/networkd.c works:

static void
write_network_file(net_definition* def, const char* rootdir, const char* path)
{
    GString* s = NULL;

    /* do we need to write a .network file? */
    if (!def->dhcp4 && !def->dhcp6 && !def->bridge && !def->bond &&
        !def->ip4_addresses && !def->ip6_addresses && !def->gateway4 && !def->gateway6 &&
        !def->ip4_nameservers && !def->ip6_nameservers && !def->has_vlans)
        return;

This interface has none of those, so no network file is generated, so the interface stays down.

I'm not sure how you could actually get netplan to generate a network file without changing the code.

(FWIW, this is done in /e/n/i as 'iface ens7 inet6 auto')

Revision history for this message
Daniel Axtens (daxtens) wrote :

Ok, so further investigation shows that you can achieve the desired effect by specifying dhcp6: true - this will kick off autoconfiguration even if DHCP is not involved at all (e.g. SLAAC+RDNSS).

There are 2 things I'd like to do for this:
 - clarify the docs
 - (potentially) add an auto6 option that is an alias for dhcp6, just to make things more clear.

Revision history for this message
Daniel Axtens (daxtens) wrote :

This is now be documented based on https://github.com/CanonicalLtd/netplan/pull/10/files#diff-4e40b87174cfd3efbd425ab9f3bcec15, marking as fix committed.

Changed in netplan:
status: New → Fix Committed
Revision history for this message
Daniel Axtens (daxtens) wrote :

The fix is in Bionic, marking as Fix Released.

Changed in netplan:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.