0ba0c1ae16
the clients
15 lines
696 B
Plaintext
15 lines
696 B
Plaintext
[Interface]
|
|
Address = {{ vpn_network }}.1/24
|
|
SaveConfig = false
|
|
ListenPort = {{ vpn_port }}
|
|
PrivateKey = {{ vpn_server_private_key.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 vpn_client_public_keys.results %}
|
|
# {{ i.item }}
|
|
[Peer]
|
|
PublicKey = {{ i.stdout }}
|
|
AllowedIPs = {{ vpn_network }}.{{ loop.index0 + 2 }}/32
|
|
|
|
{% endfor %} |