summaryrefslogtreecommitdiff
path: root/data/templates/ipsec/swanctl/peer.tmpl
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-15 19:13:43 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-15 19:39:22 +0200
commit74878d14157408ef3a4c42f32608dcd5bbf812a1 (patch)
treef36c98e6b95bf4255d6fbb1692d4130630d75a03 /data/templates/ipsec/swanctl/peer.tmpl
parentbcb1bffec87aaab9980e52ae297bd0ff588159b9 (diff)
downloadvyos-1x-74878d14157408ef3a4c42f32608dcd5bbf812a1.tar.gz
vyos-1x-74878d14157408ef3a4c42f32608dcd5bbf812a1.zip
ipsec: T3830: set connections.<conn>.remote<suffix>.id to "peer" if undefined
Restore "default" behavior from ipsec.conf
Diffstat (limited to 'data/templates/ipsec/swanctl/peer.tmpl')
-rw-r--r--data/templates/ipsec/swanctl/peer.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/data/templates/ipsec/swanctl/peer.tmpl b/data/templates/ipsec/swanctl/peer.tmpl
index 951a1b22c..5d69b3d66 100644
--- a/data/templates/ipsec/swanctl/peer.tmpl
+++ b/data/templates/ipsec/swanctl/peer.tmpl
@@ -42,9 +42,9 @@
{% endif %}
}
remote {
-{% if peer_conf.authentication.remote_id is defined %}
+{% if peer_conf.authentication is defined and peer_conf.authentication.remote_id is defined and peer_conf.authentication.remote_id is not none %}
id = "{{ peer_conf.authentication.remote_id }}"
-{% elif peer[0:1] == '@' %}
+{% else %}
id = "{{ peer }}"
{% endif %}
auth = {{ 'psk' if peer_conf.authentication.mode == 'pre-shared-secret' else 'pubkey' }}