wireguard
Installation
Wireguard can be installed directly from apt
sudo apt install wireguard
Setup client from a configuration file
A configuration file will look something like this
[Interface]
Address = 10.200.200.3/32
PrivateKey = [Client's private key]
DNS = 8.8.8.8
[Peer]
PublicKey = [Server's public key]
PresharedKey = [Pre-shared key, same for server and client]
Endpoint = [Server Addr:Server Port]
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 21
- Make sure that the filename of the configuration file can be a valid interface name. It should not have any special characters such as
-or_. - Copy the configuration file into the
/etc/wireguarddirectory.
Assuming the configuration file is called wg0.conf
sudo cp wg0.conf /etc/wireguard/wg0.conf
Usage
Run wireguard
sudo wg-quick up wg0
Close wireguard
sudo wg-quick down wg0