infra/templates/wireguard/wg0.netdev.j2

32 lines
665 B
Text
Raw Permalink Normal View History

2025-02-18 21:34:39 +00:00
[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