Skip to content

Instantly share code, notes, and snippets.

@blues911
Created May 28, 2020 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blues911/ca5d7958c385e45e80696c02fbf278a7 to your computer and use it in GitHub Desktop.
Save blues911/ca5d7958c385e45e80696c02fbf278a7 to your computer and use it in GitHub Desktop.
WireGuard VPN client configuration (Ubuntu)
#!/bin/bash
# https://www.thomas-krenn.com/en/wiki/Ubuntu_Desktop_as_WireGuard_VPN_client_configuration
# installation
sudo add-apt-repository ppa:wireguard/wireguard
sudo apt update
sudo apt install wireguard
# configuration
sudo -i
cd /etc/wireguard
umask 077
wg genkey > private-key
wg pubkey > public-key < private-key
nano /etc/wireguard/wg0.conf
# [Interface]
# Address = 10.11.0.20/32
# PrivateKey =
#
# [Peer]
# PublicKey =
# AllowedIPs = 10.11.0.0/24
# Endpoint =
# PersistentKeepalive = 5
exit
# create systemd service
sudo systemctl enable wg-quick@wg0.service
# commands for service controle:
sudo systemctl start wg-quick@wg0.service
sudo systemctl status wg-quick@wg0.service
sudo systemctl stop wg-quick@wg0.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment