diff options
| author | Kumar Damani <me@kumardamani.net> | 2022-09-07 20:40:17 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2022-09-07 20:40:17 +0000 |
| commit | bbe10895d9df8dd7899bbd65575d5bf12e57f8c8 (patch) | |
| tree | 244d2f1ad38320863fb60f695c88c97799be1171 /roles/wireguard/templates | |
| parent | 4d34de2f5e757bfeae5738547aabb61d3d28a2f8 (diff) | |
| parent | c85806e3289b5e207d51d382f8dc75edad04404d (diff) | |
Merge branch 'alpine' into 'master'
switched to alpine initial commit
See merge request kdam0/vps!2
Diffstat (limited to 'roles/wireguard/templates')
| -rw-r--r-- | roles/wireguard/templates/wg0.conf.j2 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/roles/wireguard/templates/wg0.conf.j2 b/roles/wireguard/templates/wg0.conf.j2 index 6e7bcc1..5201c32 100644 --- a/roles/wireguard/templates/wg0.conf.j2 +++ b/roles/wireguard/templates/wg0.conf.j2 @@ -1,12 +1,13 @@ # {{ ansible_managed }} [Interface] +{% if ansible_os_family == "Debian" %} Address = {{ wireguard_server_ip }} +{% endif %} 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 +PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;iptables -A FORWARD -o %i -j ACCEPT +PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;iptables -D FORWARD -o %i -j ACCEPT {% for peer in wireguard_peers %} |
