OpenVPN or Wireguard tutorial?

just in case somebody stumbles over this topic trying to configure wireguard (as I did) and hitting a dead end as the pastes in the linked thread are down by now (as expected), I share with you my pseudo-tutorial (what eventually worked for me) to set up a Vero as a WireGuard “client”:

ssh to your Vero
first we install wireguard and openresolv, which you need if you want to provide a DNS in your conf

sudo apt install wireguard-tools
sudo apt install openresolv

now we configure the client (you can name wg0 however you want, just change it accordingly in the following):

sudo nano /etc/wireguard/wg0.conf

paste the config, save and exit nano
you can now establish and test the connection with

sudo wg-quick up wg0
sudo wg

if you want to have the connection to be automatically established, you can enable a system.d service. we will first manually disconnect, then configure the service and test it:

sudo wg-quick down wg0
sudo systemctl enable wg-quick@wg0.service

I think it is prudent to wait for network in this case, so we edit the service and add connman-wait-for-network.service to the Wants and After line in Unit, so it looks like this in the beginning::

sudo nano /lib/systemd/system/wg-quick@.service

[Unit]
Description=WireGuard via wg-quick(8) for %I
After=network-online.target nss-lookup.target
Wants=network-online.target nss-lookup.target connman-wait-for-network.service
After=connman-wait-for-network.service
PartOf=wg-quick.target

now we can start the service and test it:

sudo systemctl start wg-quick@wg0.service
sudo systemctl status wg-quick@wg0.service
sudo wg

now it should work. hooray.

feel free to point out problems with my approach, I’m pretty much learning as I go. What tripped me up was the resolve error when having a DNS = line in the conf. it got sorted by installing openresolv.

cheers

3 Likes