summaryrefslogtreecommitdiff
path: root/roles/wireguard
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-02-29 19:08:52 +0100
committerChristian Pointner <equinox@spreadspace.org>2020-02-29 20:30:27 +0100
commit194686564ee07a0030ef007fa9633f6f93ac5358 (patch)
tree4b48471a96f5fe0a77f3a81b1a67a34fe8b04260 /roles/wireguard
parentupdate accesspoints (diff)
ele-router basic wireguard setup
Diffstat (limited to 'roles/wireguard')
-rw-r--r--roles/wireguard/gateway/defaults/main.yml13
-rw-r--r--roles/wireguard/gateway/templates/systemd.netdev.j22
2 files changed, 13 insertions, 2 deletions
diff --git a/roles/wireguard/gateway/defaults/main.yml b/roles/wireguard/gateway/defaults/main.yml
index 8b1ab7f6..69846fc3 100644
--- a/roles/wireguard/gateway/defaults/main.yml
+++ b/roles/wireguard/gateway/defaults/main.yml
@@ -7,10 +7,21 @@
# addresses:
# - 192.168.255.254/24
# ip_masq: yes
+# ip_snat:
+# interface: eth1
+# to: 1.2.3.4
+# port_forwardings:
+# - dest: 1.2.3.4
+# tcp_ports:
+# 80: 192.158.255.3:80
+# udp_ports:
+# 123: 192.158.255.3:200
# peers:
# - pub_key: public_key_of_peer
# keepalive_interval: 10
-# endpoint: 5.6.7.8:1234
+# endpoint:
+# host: 5.6.7.8
+# port: 1234
# allowed_ips:
# - 192.168.255.3/32
# - 192.168.123.0/24
diff --git a/roles/wireguard/gateway/templates/systemd.netdev.j2 b/roles/wireguard/gateway/templates/systemd.netdev.j2
index 62f0d0a6..96399b52 100644
--- a/roles/wireguard/gateway/templates/systemd.netdev.j2
+++ b/roles/wireguard/gateway/templates/systemd.netdev.j2
@@ -18,7 +18,7 @@ PublicKey={{ peer.pub_key }}
AllowedIPs={{ ip }}
{% endfor %}
{% if 'endpoint' in peer %}
-Endpoint={{ peer.endpoint }}
+Endpoint={{ peer.endpoint.host }}:{{ peer.endpoint.port | default(51820) }}
{% endif %}
{% if 'keepalive_interval' in peer %}
PersistentKeepalive={{ peer.keepalive_interval }}