infra/templates/wireguard/wg0.netdev.j2
2025-02-18 23:34:39 +02:00

31 lines
665 B
Django/Jinja

[NetDev]
Name=wg0
Kind=wireguard
Description=Wireguard tunnel wg0
[WireGuard]
ListenPort=51820
PrivateKey={{ wireguard_private_key.stdout }}
{% for peer in groups['wireguard'] %}
{% if peer != inventory_hostname %}
[WireGuardPeer]
PublicKey={{ hostvars[peer].wireguard_public_key.stdout }}
AllowedIPs={{ hostvars[peer].wireguard_ip }}/32
PersistentKeepalive=25
{% endif %}
{% endfor %}
# ouroboros
[WireGuardPeer]
PublicKey={{ ouroboros_wireguard_public_key }}
AllowedIPs={{ ouroboros_wireguard_ip }}/32
PersistentKeepalive=25
# mobile
[WireGuardPeer]
PublicKey={{ mobile_wireguard_public_key }}
AllowedIPs={{ mobile_wireguard_ip }}/32
PersistentKeepalive=25