aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/linuxserver/example_config/templates
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-03-12 21:24:22 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-03-12 21:35:58 +0100
commit3ba44927180453caa1d225d8a2275be382b7cbfb (patch)
tree67298069bd8f921aeb9516e6c254b5c3b0e1f014 /test/linuxserver/example_config/templates
parentREADME: update (diff)
downloadwg-api-web-3ba44927180453caa1d225d8a2275be382b7cbfb.tar.gz
wg-api-web-3ba44927180453caa1d225d8a2275be382b7cbfb.zip
test/linuxserver: add a test configuration
Diffstat (limited to 'test/linuxserver/example_config/templates')
-rw-r--r--test/linuxserver/example_config/templates/peer.conf11
-rw-r--r--test/linuxserver/example_config/templates/server.conf6
2 files changed, 17 insertions, 0 deletions
diff --git a/test/linuxserver/example_config/templates/peer.conf b/test/linuxserver/example_config/templates/peer.conf
new file mode 100644
index 0000000..cd6e3ae
--- /dev/null
+++ b/test/linuxserver/example_config/templates/peer.conf
@@ -0,0 +1,11 @@
+[Interface]
+Address = ${CLIENT_IP}
+PrivateKey = $(cat /config/${PEER_ID}/privatekey-${PEER_ID})
+ListenPort = 51820
+DNS = ${PEERDNS}
+
+[Peer]
+PublicKey = $(cat /config/server/publickey-server)
+PresharedKey = $(cat /config/${PEER_ID}/presharedkey-${PEER_ID})
+Endpoint = ${SERVERURL}:${SERVERPORT}
+AllowedIPs = ${ALLOWEDIPS} \ No newline at end of file
diff --git a/test/linuxserver/example_config/templates/server.conf b/test/linuxserver/example_config/templates/server.conf
new file mode 100644
index 0000000..757682d
--- /dev/null
+++ b/test/linuxserver/example_config/templates/server.conf
@@ -0,0 +1,6 @@
+[Interface]
+Address = ${INTERFACE}.1
+ListenPort = 51820
+PrivateKey = $(cat /config/server/privatekey-server)
+PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth+ -j MASQUERADE
+PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth+ -j MASQUERADE