From 8a15595e1ac3d9e3e15f40f8b2256768f8d71f0c Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 5 Aug 2023 09:02:59 +0200 Subject: dhcpv6: T5428: client renewal fails when running inside VRF --- data/templates/dhcp-client/dhcp6c_daemon-options.j2 | 2 -- data/templates/dhcp-client/ipv6.override.conf.j2 | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) delete mode 100644 data/templates/dhcp-client/dhcp6c_daemon-options.j2 create mode 100644 data/templates/dhcp-client/ipv6.override.conf.j2 (limited to 'data') diff --git a/data/templates/dhcp-client/dhcp6c_daemon-options.j2 b/data/templates/dhcp-client/dhcp6c_daemon-options.j2 deleted file mode 100644 index d33d418fc..000000000 --- a/data/templates/dhcp-client/dhcp6c_daemon-options.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{% set no_release = '-n' if dhcpv6_options.no_release is vyos_defined else '' %} -DHCP6C_OPTS="-D -k /run/dhcp6c/dhcp6c.{{ ifname }}.sock -c /run/dhcp6c/dhcp6c.{{ ifname }}.conf -p /run/dhcp6c/dhcp6c.{{ ifname }}.pid {{ no_release }} {{ ifname }}" diff --git a/data/templates/dhcp-client/ipv6.override.conf.j2 b/data/templates/dhcp-client/ipv6.override.conf.j2 new file mode 100644 index 000000000..b0c0e0544 --- /dev/null +++ b/data/templates/dhcp-client/ipv6.override.conf.j2 @@ -0,0 +1,12 @@ +{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is vyos_defined else '' %} +{% set no_release = '-n' if dhcpv6_options.no_release is vyos_defined else '' %} +{% set dhcp6c_options = '-D -k ' ~ dhcp6_client_dir ~ '/dhcp6c.' ~ ifname ~ '.sock -c ' ~ dhcp6_client_dir ~ '/dhcp6c.' ~ ifname ~ '.conf -p ' ~ dhcp6_client_dir ~ '/dhcp6c.' ~ ifname ~ '.pid ' ~ no_release %} + +[Unit] +ConditionPathExists={{ dhcp6_client_dir }}/dhcp6c.%i.conf + +[Service] +ExecStart= +ExecStart={{ vrf_command }}/usr/sbin/dhcp6c {{ dhcp6c_options }} {{ ifname }} +WorkingDirectory={{ dhcp6_client_dir }} +PIDFile={{ dhcp6_client_dir }}/dhcp6c.%i.pid -- cgit v1.2.3