2018-05-24 15:15:27 +00:00
|
|
|
[Interface]
|
2018-10-22 20:49:09 +00:00
|
|
|
Address = {{ wireguard_server_ip }}
|
2018-05-24 15:15:27 +00:00
|
|
|
ListenPort = {{ wireguard_port }}
|
|
|
|
PrivateKey = {{ lookup('file', wireguard_config_path + '/private/' + IP_subject_alt_name) }}
|
2018-06-01 14:06:03 +00:00
|
|
|
SaveConfig = false
|
2018-05-24 15:15:27 +00:00
|
|
|
|
2018-11-12 17:03:31 +00:00
|
|
|
{% for u in wireguard_users %}
|
|
|
|
{% if u in users %}
|
|
|
|
{% set index = loop.index %}
|
2018-05-24 15:15:27 +00:00
|
|
|
|
|
|
|
[Peer]
|
|
|
|
# {{ u }}
|
|
|
|
PublicKey = {{ lookup('file', wireguard_config_path + '/public/' + u) }}
|
2018-11-12 17:03:31 +00:00
|
|
|
AllowedIPs = {{ wireguard_network_ipv4['clients_range'] }}.{{ wireguard_network_ipv4['clients_start'] + index }}/32{% if ipv6_support %},{{ wireguard_network_ipv6['clients_range'] }}{{ wireguard_network_ipv6['clients_start'] + index }}/128{% endif %}
|
|
|
|
|
|
|
|
{% endif %}
|
2018-05-24 15:15:27 +00:00
|
|
|
{% endfor %}
|