61 lines
1.4 KiB
Django/Jinja
61 lines
1.4 KiB
Django/Jinja
connections {
|
|
{%- for connection in connections if connection.ready %}
|
|
{{ connection.name }} {
|
|
version = 2
|
|
proposals = aes256-sha256-modp2048,aes256-sha1-modp1024
|
|
reauth_time = 28800
|
|
unique = replace
|
|
|
|
local_addrs = {{ local_addrs }}
|
|
remote_addrs = {{ connection.remote_addrs }}
|
|
|
|
local {
|
|
id = {{ connection.local_id }}
|
|
{%- if connection.auth == 'certificate' %}
|
|
auth = pubkey
|
|
certs = site-to-site.pem
|
|
{%- else %}
|
|
auth = psk
|
|
{%- endif %}
|
|
}
|
|
|
|
remote {
|
|
id = {{ connection.remote_id }}
|
|
{%- if connection.auth == 'certificate' %}
|
|
auth = pubkey
|
|
cacerts = {{ connection.remote_cacert }}
|
|
{%- else %}
|
|
auth = psk
|
|
{%- endif %}
|
|
}
|
|
|
|
children {
|
|
{{ connection.name }} {
|
|
mode = tunnel
|
|
local_ts = {{ connection.local_ts }}
|
|
remote_ts = {{ connection.remote_cidrs }}
|
|
esp_proposals = aes256-sha256,aes256-sha1
|
|
life_time = 3600
|
|
dpd_action = restart
|
|
start_action = start
|
|
close_action = none
|
|
}
|
|
}
|
|
|
|
rekey_time = 10800
|
|
dpd_delay = 10
|
|
dpd_timeout = 120
|
|
}
|
|
{%- endfor %}
|
|
}
|
|
|
|
secrets {
|
|
{%- for connection in connections if connection.ready and connection.auth == 'psk' %}
|
|
ike-psk-{{ connection.name }} {
|
|
id-1 = {{ connection.local_id }}
|
|
id-2 = {{ connection.remote_id }}
|
|
secret = "{{ connection.psk }}"
|
|
}
|
|
{%- endfor %}
|
|
}
|