Skip to content

Instantly share code, notes, and snippets.

@gardner
Created September 21, 2019 07:15
Show Gist options
  • Save gardner/b7d387f350e68dd4e47f269d3c7af52b to your computer and use it in GitHub Desktop.
Save gardner/b7d387f350e68dd4e47f269d3c7af52b to your computer and use it in GitHub Desktop.
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