[Interface] PrivateKey = {{ wireguard_private_key }} {% if wireguard_address %} {% if wireguard_address is string %} Address = {{ wireguard_address }} {% elif wireguard_address is sequence %} {% for address in wireguard_address %} Address = {{ address }} {% endfor %} {% endif %} {% endif %} {% if wireguard_port %} ListenPort = {{ wireguard_port }} {% endif %} {% if wireguard_peers is not string and wireguard_peers is sequence %} {% for peer in wireguard_peers %} [Peer] {% if "public_key" in peer %} PublicKey = {{ peer.public_key }} {% endif %} {% if "endpoint" in peer %} Endpoint = {{ peer.endpoint }} {% endif %} {% if "allowed_ips" in peer %} {% if peer.allowed_ips is string %} AllowedIPs = {{ peer.allowed_ips }} {% elif peer.allowed_ips is sequence %} AllowedIPs = {{ peer.allowed_ips.join(', ') }} {% endif %} {% endif %} {% endfor %} {% endif %}