summaryrefslogtreecommitdiff
path: root/src/etc
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-04-14 21:26:47 +0200
committerChristian Breunig <christian@breunig.cc>2025-04-14 21:26:47 +0200
commit588f2e02028bc3e0d1203c750c3cba56fb8291f2 (patch)
tree4b663f8985a7a0b2cc0325cee1b3924843bedcfe /src/etc
parent97e74caa682298323165baa5055483405b740dac (diff)
downloadvyos-1x-588f2e02028bc3e0d1203c750c3cba56fb8291f2.tar.gz
vyos-1x-588f2e02028bc3e0d1203c750c3cba56fb8291f2.zip
netplug: T7360: DHCPv6 address is not cleared when interface goes oper-down
When an interface goes down - e.g. cable unplugged - the DHCPv6 assigned IPv6 address is not removed from said interface. We should provide the same behavior as with IPv4. IPv6 address should be removed and dhcpv6 client restarted once the interface goes operational up again.
Diffstat (limited to 'src/etc')
-rwxr-xr-xsrc/etc/netplug/vyos-netplug-dhcp-client5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/etc/netplug/vyos-netplug-dhcp-client b/src/etc/netplug/vyos-netplug-dhcp-client
index 42ae5df1d..a230fe900 100755
--- a/src/etc/netplug/vyos-netplug-dhcp-client
+++ b/src/etc/netplug/vyos-netplug-dhcp-client
@@ -48,10 +48,13 @@ config = Config()
interface_path = ['interfaces'] + Section.get_config_path(interface).split()
systemdV4_service = f'dhclient@{interface}.service'
+systemdV6_service = f'dhcp6c@{interface}.service'
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'])
@@ -64,3 +67,5 @@ elif in_out == 'in':
# 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}')