quad 9 server und kein Speichern der Einstellungen beim

herunterfahren
This commit is contained in:
Stefan Märkle 2020-12-02 22:10:02 +01:00
parent 3a8c1c5ca0
commit 51ca929100
2 changed files with 6 additions and 4 deletions

View File

@ -1,10 +1,10 @@
[Interface] [Interface]
Address = {{ vpn_network }}.{{item|int + 1}}/32 Address = {{ vpn_network }}.{{item|int + 1}}/32
DNS = {{ vpn_network }}.1 DNS = 9.9.9.9
PrivateKey = {{ private_key_files.results[item|int].stdout }} PrivateKey = {{ private_key_files.results[item|int].stdout }}
[Peer] [Peer]
PublicKey = {{ public_key_files.results[0].stdout }} PublicKey = {{ public_key_files.results[0].stdout }}
AllowedIPs = 0.0.0.0/0 AllowedIPs = 0.0.0.0/0
Endpoint = {{ ansible_default_ipv4.address }}:{{ vpn_port }} Endpoint = {{ ansible_ssh_host }}:{{ vpn_port }}
PersistentKeepalive = 1 PersistentKeepalive = 0

View File

@ -1,8 +1,10 @@
[Interface] [Interface]
Address = {{ vpn_network }}.1/24 Address = {{ vpn_network }}.1/24
SaveConfig = true SaveConfig = false
ListenPort = {{ vpn_port }} ListenPort = {{ vpn_port }}
PrivateKey = {{ private_key_files.results[0].stdout }} PrivateKey = {{ private_key_files.results[0].stdout }}
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o ens5 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o ens5 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o ens5 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o ens5 -j MASQUERADE
{% for i in range(vpn_clients) %} {% for i in range(vpn_clients) %}
[Peer] [Peer]