[Interface]
PrivateKey = {{ wg_client_private_keys[item.name] }}
Address = {{ item.address }}/32
{% if wireguard_dns_servers is defined %}
DNS = {{ wireguard_dns_servers | join(', ') }}
{% endif %}
{% if wireguard_mtu is defined %}
MTU = {{ wireguard_mtu }}
{% endif %}

[Peer]
PublicKey = {{ wg_server_public_key }}
Endpoint = {{ wireguard_server_ip }}:{{ wireguard_port }}
AllowedIPs = {{ wireguard_network }}
{% if wireguard_keepalive is defined %}
PersistentKeepalive = {{ wireguard_keepalive }}
{% endif %}
{% if wireguard_pre_shared_key | default(false) and wg_client_psk_keys is defined %}
PresharedKey = {{ wg_client_psk_keys[item.name] }}
{% endif %}
