summaryrefslogtreecommitdiff
path: root/data/templates/openvpn/client.conf.j2
diff options
context:
space:
mode:
Diffstat (limited to 'data/templates/openvpn/client.conf.j2')
-rw-r--r--data/templates/openvpn/client.conf.j231
1 files changed, 31 insertions, 0 deletions
diff --git a/data/templates/openvpn/client.conf.j2 b/data/templates/openvpn/client.conf.j2
new file mode 100644
index 0000000..9edcdc8
--- /dev/null
+++ b/data/templates/openvpn/client.conf.j2
@@ -0,0 +1,31 @@
+### Autogenerated by interfaces_openvpn.py ###
+
+{% if ip is vyos_defined %}
+ifconfig-push {{ ip[0] }} {{ server_subnet[0] | netmask_from_cidr }}
+{% endif %}
+{% if push_route is vyos_defined %}
+{% for route in push_route %}
+push "route {{ route | address_from_cidr }} {{ route | netmask_from_cidr }}"
+{% endfor %}
+{% endif %}
+{% if subnet is vyos_defined %}
+{% for network in subnet %}
+iroute {{ network | address_from_cidr }} {{ network | netmask_from_cidr }}
+{% endfor %}
+{% endif %}
+{# ipv6_remote is only set when IPv6 server is enabled #}
+{% if ipv6_remote is vyos_defined %}
+# IPv6
+{% if ipv6_ip is vyos_defined %}
+ifconfig-ipv6-push {{ ipv6_ip[0] }} {{ ipv6_remote }}
+{% endif %}
+{% for route6 in ipv6_push_route %}
+push "route-ipv6 {{ route6 }}"
+{% endfor %}
+{% for net6 in ipv6_subnet %}
+iroute-ipv6 {{ net6 }}
+{% endfor %}
+{% endif %}
+{% if disable is vyos_defined %}
+disable
+{% endif %}