summaryrefslogtreecommitdiff
path: root/data/templates/ipsec/ike-esp.tmpl
diff options
context:
space:
mode:
authorSimon <965089+sarthurdev@users.noreply.github.com>2021-05-28 16:35:12 +0200
committerGitHub <noreply@github.com>2021-05-28 16:35:12 +0200
commiteabc5f1c2e5bfe548cb3d62f2f85f8d61be29b92 (patch)
tree2efe4cf2ad2e0cb9b9f355dffa22707b26f785ef /data/templates/ipsec/ike-esp.tmpl
parentb0e1c8a9c9ef470297bf3c9f5059ad7c720c46ff (diff)
downloadvyos-1x-eabc5f1c2e5bfe548cb3d62f2f85f8d61be29b92.tar.gz
vyos-1x-eabc5f1c2e5bfe548cb3d62f2f85f8d61be29b92.zip
ipsec: T2816: IPSec python rework, includes DMVPN and VTI support
Diffstat (limited to 'data/templates/ipsec/ike-esp.tmpl')
-rw-r--r--data/templates/ipsec/ike-esp.tmpl32
1 files changed, 32 insertions, 0 deletions
diff --git a/data/templates/ipsec/ike-esp.tmpl b/data/templates/ipsec/ike-esp.tmpl
new file mode 100644
index 000000000..deeb8c80d
--- /dev/null
+++ b/data/templates/ipsec/ike-esp.tmpl
@@ -0,0 +1,32 @@
+{% macro conn(ike, ike_ciphers, esp, esp_ciphers) -%}
+{% if ike %}
+{% if "key_exchange" in ike %}
+ keyexchange = {{ ike.key_exchange }}
+{% endif %}
+ ike = {{ ike_ciphers }}
+{% if "lifetime" in ike %}
+ ikelifetime = {{ ike.lifetime }}s
+{% endif %}
+ reauth = {{ ike.ikev2_reauth if "ikev2_reauth" in ike else "no" }}
+ closeaction = {{ ike.close_action if "close_action" in ike else "none" }}
+{% if "dead_peer_detection" in ike %}
+ dpdaction = {{ ike.dead_peer_detection.action }}
+ dpdtimeout = {{ ike.dead_peer_detection.timeout }}
+ dpddelay = {{ ike.dead_peer_detection.interval }}
+{% endif %}
+{% if "key_exchange" in ike and ike.key_exchange == "ikev1" and "mode" in ike and ike.mode == "aggressive" %}
+ aggressive = yes
+{% endif %}
+{% if "key_exchange" in ike and ike.key_exchange == "ikev2" %}
+ mobike = {{ "yes" if "mobike" not in ike or ike.mobike == "enable" else "no" }}
+{% endif %}
+{% endif %}
+{% if esp %}
+ esp = {{ esp_ciphers }}
+{% if "lifetime" in esp %}
+ keylife = {{ esp.lifetime }}s
+{% endif %}
+ compress = {{ 'yes' if "compression" in esp and esp.compression == 'enable' else 'no' }}
+ type = {{ esp.mode if "mode" in esp else "tunnel" }}
+{% endif %}
+{%- endmacro %}