Cannot describe an IPv6-only SLAAC interface in yaml
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:
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,
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_
{
GString* s = NULL;
/* do we need to write a .network file? */
if (!def->dhcp4 && !def->dhcp6 && !def->bridge && !def->bond &&
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')
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.