Created
May 28, 2020 20:17
-
-
Save blues911/ca5d7958c385e45e80696c02fbf278a7 to your computer and use it in GitHub Desktop.
WireGuard VPN client configuration (Ubuntu)
This file contains 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
#!/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 [email protected] | |
# commands for service controle: | |
sudo systemctl start [email protected] | |
sudo systemctl status [email protected] | |
sudo systemctl stop [email protected] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment