diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-06-15 11:08:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 11:08:42 +0200 |
commit | 08f69fc2867218923a3f3878d3bc76ebea09cee2 (patch) | |
tree | 1ff04e1e0aba2167b746f2f1373544e3d38b055d /data/templates/ipsec/swanctl/profile.tmpl | |
parent | 78099bccc510c90ad7cfa5f56475ba024d5d53a7 (diff) | |
parent | 11b5636519b360074eb2877006f2d8d63d9f6610 (diff) | |
download | vyos-1x-08f69fc2867218923a3f3878d3bc76ebea09cee2.tar.gz vyos-1x-08f69fc2867218923a3f3878d3bc76ebea09cee2.zip |
Merge pull request #881 from sarthurdev/ipsec_swanctl
ipsec: T2816: T645: T3613: Migrated IPsec to swanctl format
Diffstat (limited to 'data/templates/ipsec/swanctl/profile.tmpl')
-rw-r--r-- | data/templates/ipsec/swanctl/profile.tmpl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/data/templates/ipsec/swanctl/profile.tmpl b/data/templates/ipsec/swanctl/profile.tmpl new file mode 100644 index 000000000..e4b36b99f --- /dev/null +++ b/data/templates/ipsec/swanctl/profile.tmpl @@ -0,0 +1,34 @@ +{% macro conn(name, profile_conf, ike, esp, ciphers) %} +{% for interface in profile_conf.bind.tunnel %} + dmvpn-{{ name }}-{{ interface }} { + proposals = {{ ciphers.ike[profile_conf.ike_group] }} + version = {{ ike.key_exchange[4:] if "key_exchange" in ike else "0" }} + rekey_time = {{ ike.lifetime if 'lifetime' in ike else '28800' }}s + keyingtries = 0 +{% if profile_conf.authentication.mode == 'pre-shared-secret' %} + local { + auth = psk + } + remote { + auth = psk + } +{% endif %} + children { + dmvpn { + esp_proposals = {{ ciphers.esp[profile_conf.esp_group] }} + rekey_time = {{ esp.lifetime if 'lifetime' in esp else '3600' }}s + rand_time = 540s + local_ts = dynamic[gre] + remote_ts = dynamic[gre] + mode = {{ esp.mode if "mode" in esp else "transport" }} +{% if 'dead_peer_detection' in ike and 'action' in ike.dead_peer_detection %} + dpd_action = {{ ike.dead_peer_detection.action }} +{% endif %} +{% if 'compression' in esp and esp['compression'] == 'enable' %} + ipcomp = yes +{% endif %} + } + } + } +{% endfor %} +{% endmacro %} |