Overview
Wireguard is okay on linux, but it does cause some issues with DNS that I don’t like. Basically, if you specify a DNS server, then all traffic uses that server. I have not figured out a way to perform split DNS. So for now, I simply use network manager to that I can toggle the VPN on and off.
Create keypairs
First, you need keys. To generate this, make sure you have wireguard-tools
installed on whatever distro you are using. Then, use the following commands:
umask 077
mkdir ~/wg-keys
wg genkey > ~/wg-keys/private
wg pubkey < ~/wg-keys/private > ~/wg-keys/public
Create network manager module
First, you have to create a wg-quick
config. Name it something like wg0.conf
. It should look something like this:
[Interface]
Address = 10.0.0.20/24
Table = auto
DNS = 192.168.5.1
PrivateKey = 0000000000000000000000000000000000000000000=
[Peer]
PublicKey = 1111111111111111111111111111111111111111111=
AllowedIPs = 10.0.0.0/24, 192.168.5.0/24
Endpoint = ddns.flaskforge.com:51820
Once this is created, run the following command to add it to network manager:
nmcli connection import type wireguard file wg0.conf
And boom! Wireguard at a click of a button.