summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-08-05 09:02:59 +0200
committerChristian Breunig <christian@breunig.cc>2023-08-05 09:28:35 +0200
commit8a15595e1ac3d9e3e15f40f8b2256768f8d71f0c (patch)
tree2ecb45cd5ab98423ad534c415e2703e09f96c468 /data/templates
parent6fbce6b6fe495268f896f95fea1a0837367c664a (diff)
downloadvyos-1x-8a15595e1ac3d9e3e15f40f8b2256768f8d71f0c.tar.gz
vyos-1x-8a15595e1ac3d9e3e15f40f8b2256768f8d71f0c.zip
dhcpv6: T5428: client renewal fails when running inside VRF
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/dhcp-client/dhcp6c_daemon-options.j22
-rw-r--r--data/templates/dhcp-client/ipv6.override.conf.j212
2 files changed, 12 insertions, 2 deletions
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