diff options
Diffstat (limited to 'roles/wireguard/templates')
| -rw-r--r-- | roles/wireguard/templates/wg0.conf.j2 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/roles/wireguard/templates/wg0.conf.j2 b/roles/wireguard/templates/wg0.conf.j2 new file mode 100644 index 0000000..6e7bcc1 --- /dev/null +++ b/roles/wireguard/templates/wg0.conf.j2 @@ -0,0 +1,17 @@ +# {{ ansible_managed }} + +[Interface] +Address = {{ wireguard_server_ip }} +ListenPort = {{ wireguard_server_listen_port }} +PrivateKey = {{ wireguard_server_priv_key }} +PostUp = iptables -A FORWARD -i wg0 -o wg0 -j ACCEPT +PostUp = iptables -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE +PostDown = iptables -w -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -w -t nat -D POSTROUTING -o eth0 -j MASQUERADE + + +{% for peer in wireguard_peers %} +[Peer] +PublicKey = {{ peer.peer_key }} +AllowedIPs = {{ peer.peer_ip}} + +{% endfor %} |
