When an interface is configured only with IPv6 PD and not with DHCPv6 for its own address, the dhcp6c service will not be restarted after the link goes down and comes back up.
Example config:
interfaces {
ethernet eth0 {
address dhcp <-- No dhcpv6 here!
dhcpv6-options {
pd 0 { <-- Using PD
interface br0.1 {
address 1
sla-id 1
}
length 56
}
}
ipv6 {
address {
autoconf <-- Using autoconf for own address
}
}
}
}The problem comes from the /etc/netplug/vyos-netplug-dhcp-client file (https://github.com/vyos/vyos-1x/blob/current/src/etc/netplug/vyos-netplug-dhcp-client), which correctly stops the dhcp6c client but then never restarts it as the logic used for restart is different for the logic used for stopping and is incorrect:
if in_out == 'out':
# Interface moved state to down
if is_systemd_service_active(systemdV4_service):
cmd(f'systemctl stop {systemdV4_service}')
if is_systemd_service_active(systemdV6_service):
cmd(f'systemctl stop {systemdV6_service}')
elif in_out == 'in':
if config.exists_effective(interface_path + ['address']):
tmp = config.return_effective_values(interface_path + ['address'])
# Always (re-)start the DHCP(v6) client service. If the DHCP(v6) client
# is already running - which could happen if the interface is re-
# configured in operational down state, it will have a backoff
# time increasing while not receiving a DHCP(v6) reply.
#
# To make the interface instantly available, and as for a DHCP(v6) lease
# we will re-start the service and thus cancel the backoff time.
if 'dhcp' in tmp:
cmd(f'systemctl restart {systemdV4_service}')
if 'dhcpv6' in tmp:
cmd(f'systemctl restart {systemdV6_service}')As you can see above, is_systemd_service_active(systemdV6_service) will return true and the dhcp6c client will be stopped as expected. However, tmp in this case will only be ['dhcp'], as we are using PD only and not DHCPv6 for own address assignment. As such, the if 'dhcpv6' in tmp returns false and dhcp6c is never restarted and hence IPv6 connectivity is lost any time an ethernet interface is disconnected and reconnected.
This was introduced in this commit: https://github.com/vyos/vyos-1x/commit/588f2e02028bc3e0d1203c750c3cba56fb8291f2
The fix should be to change the v6 check to also check if the ['interfaces', 'ethernet', 'eth0', 'dhcpv6-options', 'pd'] exists as well as checking if 'dhcpv6' exists in address. Either of these conditions should be sufficient to require a restart of the service