Last active
March 13, 2022 19:16
-
-
Save rudolfschmidt/2866f8987cbae4f3d8ec36688880a1c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update && apt-get upgrade | |
apt-get install wireguard | |
vim /etc/sysctl.conf | |
uncoment net.ipv4.ip_forward=1 | |
sudo sysctl -p to verify | |
apt-get install wireguard | |
cd /etc/wireguard | |
umask 077; wg genkey | tee privatekey | wg pubkey > publickey | |
vim /etc/wireguard/wg0.conf | |
server | |
------------------- | |
[Interface] | |
PrivateKey = <generated privatekey> | |
Address = 192.168.69.1/24 | |
ListenPort = 51820 | |
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | |
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE | |
[Peer] | |
PublicKey=<The Public Key of the Debian Client> | |
AllowedIPs=192.168.69.2 | |
PersistentKeepalive=25 | |
systemctl enable [email protected] | |
or | |
wg-quick up wg0 | |
client | |
------------------- | |
apt-get update && apt-get upgrade | |
apt-get install wireguard | |
vim /etc/sysctl.conf | |
uncoment net.ipv4.ip_forward=1 | |
sudo sysctl -p to verify | |
apt-get install wireguard | |
cd /etc/wireguard | |
umask 077; wg genkey | tee privatekey | wg pubkey > publickey | |
vim /etc/wireguard/wg0.conf | |
[Interface] | |
PrivateKey = <Generated Local PrivateKey> | |
Address=192.168.69.2/24 | |
[Peer] | |
PublicKey=<Public Key From Server> | |
Endpoint=<Public IP of VPN Server>:51820 | |
AllowedIPs = 0.0.0.0/0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment