Created
September 21, 2019 07:15
-
-
Save gardner/b7d387f350e68dd4e47f269d3c7af52b 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 install linux-headers-$(uname --kernel-release) && \ | |
apt-get update && \ | |
apt-get install wireguard -y && \ | |
modprobe wireguard | |
mkdir -p /etc/wireguard/keys && \ | |
cd /etc/wireguard/keys && \ | |
umask 077 && \ | |
wg genkey | tee privatekey | wg pubkey > publickey | |
private_key=$(cat privatekey) | |
public_key=$(cat publickey) | |
cat << EOF > /etc/wireguard/wg0.conf | |
[Interface] | |
PrivateKey = $private_key | |
Address = 192.168.66.1/32 | |
ListenPort = 8999 | |
[Peer] | |
PublicKey = $public_key | |
Endpoint = IP_ADDRESS:8999 | |
AllowedIPs = 0.0.0.0/0 | |
PersistentKeepalive = 25 | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment