mirror of
https://github.com/pirate/wireguard-docs.git
synced 2025-10-03 14:26:18 +00:00
rename examples
This commit is contained in:
1
example-simple-server-to-server/server1/server1.key
Normal file
1
example-simple-server-to-server/server1/server1.key
Normal file
@@ -0,0 +1 @@
|
||||
2P/3ll/TxGTjGqwcWnqJMnjwPqGw7oX1RaXlPfsf2FQ=
|
1
example-simple-server-to-server/server1/server1.key.pub
Normal file
1
example-simple-server-to-server/server1/server1.key.pub
Normal file
@@ -0,0 +1 @@
|
||||
q/+jwmL5tNuYSB3z+t9Caj00Pc1YQ8zf+uNPu/UE1wE=
|
17
example-simple-server-to-server/server1/setup.sh
Normal file
17
example-simple-server-to-server/server1/setup.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# install wireguard
|
||||
add-apt-repository ppa:wireguard/wireguard
|
||||
apt update
|
||||
apt install wireguard
|
||||
|
||||
# to enable kernel relaying/forwarding ability on bounce servers
|
||||
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
|
||||
echo "net.ipv4.conf.all.proxy_arp" >> /etc/sysctl.conf
|
||||
sudo sysctl -p /etc/sysctl.conf
|
||||
|
||||
# to add iptables forwarding rules on bounce servers
|
||||
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
iptables -A FORWARD -i wg0 -o wg0 -m conntrack --ctstate NEW -j ACCEPT
|
||||
iptables -t nat -A POSTROUTING -s 10.0.44.0/24 -o eth0 -j MASQUERADE
|
5
example-simple-server-to-server/server1/start.sh
Normal file
5
example-simple-server-to-server/server1/start.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
PEER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
wg-quick up "$PEER_DIR"/wg0.conf
|
||||
wg show
|
5
example-simple-server-to-server/server1/stop.sh
Normal file
5
example-simple-server-to-server/server1/stop.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
PEER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
wg-quick down "$PEER_DIR"/wg0.conf
|
||||
wg show
|
12
example-simple-server-to-server/server1/wg0.conf
Normal file
12
example-simple-server-to-server/server1/wg0.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
[Interface]
|
||||
# Name = server1.example-vpn.tld
|
||||
Address = 10.0.44.1/24
|
||||
ListenPort = 51820
|
||||
PrivateKey = 2P/3ll/TxGTjGqwcWnqJMnjwPqGw7oX1RaXlPfsf2FQ=
|
||||
DNS = 1.1.1.1
|
||||
|
||||
[Peer]
|
||||
# Name = server2.example-vpn.dev
|
||||
Endpoint = server2.example-vpn.dev:51820
|
||||
PublicKey = SceMEaVZaZfOGtGXjMsoJjhwxKHkb++9wjxqN1vm32s=
|
||||
AllowedIPs = 10.0.44.2/32
|
Reference in New Issue
Block a user