From 46ba786edb9c2153b617e739240c56c3159caa01 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Fri, 4 Nov 2022 18:00:54 +0200 Subject: [PATCH] rename clients list to wireguard peers --- templates/wireguard_server.conf.j2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/wireguard_server.conf.j2 b/templates/wireguard_server.conf.j2 index 31fb6c1..d32dd26 100644 --- a/templates/wireguard_server.conf.j2 +++ b/templates/wireguard_server.conf.j2 @@ -4,10 +4,12 @@ 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 %} +{% for item in wireguard_peers %} -# Client: {{ item.name }} +# Peer name: {{ item.name }} [Peer] PublicKey = {{ item.PublicKey }} AllowedIPs = {{ item.AllowedIPs }} -{% endfor %} \ No newline at end of file +{% if item.EndPointIP is defined and item.EndPointIP != '' %} +EndPoint = {{ item.EndPointIP }}:{{ listenport }} +{% endfor %}