ansible-role-wireguard_server/templates/wireguard_server.conf

13 lines
545 B
Text
Raw Normal View History

2022-10-11 09:19:17 +02:00
[Interface]
Address = {{ address }}
PrivateKey = {{ privatekey }}
ListenPort = {{ listenport }}
PostUp = iptables -t nat -A POSTROUTING -o {{ public_interface }} -j MASQUERADE; ip6tables -t nat -A POSTROUTING -o {{ public_interface }} -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -o {{ public_interface }} -j MASQUERADE; ip6tables -t nat -D POSTROUTING -o {{ public_interface }} -j MASQUERADE
{% for item in clients %}
# Client: {{ item.name }}
[Peer]
PublicKey = {{ item.PublicKey }}
AllowedIPs = {{ item.AllowedIPs }}
{% endfor %}