debian-setup/templates/network/wireguard/default/wg0.netdev.j2
2024-08-03 15:01:41 +02:00

20 lines
408 B
Django/Jinja

# {{ ansible_managed }}
[NetDev]
Name={{ vpn_interface }}
Kind=wireguard
Description=WireGuard tunnel wg0
[WireGuard]
ListenPort={{ vpn_port }}
PrivateKey={{ vpn_server_key }}
{% for peer, properties in vpn_peers.items() %}
[WireGuardPeer]
PublicKey={{ properties.public_key }}
PresharedKey={{ properties.preshared_key }}
AllowedIPs={{ properties.ip }}/32
{% if not loop.last %}
{% endif %}
{% endfor %}