EDIT: Skip my tutorial and jump directly to the recommended easier solution, as described by Loki.
TUTORIAL
I downloaded the Wireguard config file from my VPN provider, which is AirVPN, and saved it to a folder that I named “AirVPN” within my home folder on the L5.
Because the AirVPN config file saves with a long, cumbersome name, I renamed it to "wg.conf"
to simplify things for the command line. I saved this config file to my “AirVPN” folder.
These are the commands to install, turn on, and turn off Wireguard. (Change “/AirVPN/wg.conf
” to whatever you named your own directory/path.)
sudo apt install wireguard
sudo wg-quick up /home/purism/AirVPN/wg.conf
sudo wg-quick down /home/purism/AirVPN/wg.conf
You can always start and stop Wireguard using the command line, but if you want to automate the process, you can create two launchers for the home screen (one to turn “on” and one to turn “off”) Wireguard with the following text and save them to the .local/share/applications
folder in the home directory; create the folder if you don’t already have it from having created apps in the past.
Save as "WG_On.desktop"
:
[Desktop Entry]
Name=WG_On
Exec=gnome-terminal -x bash -c "sudo wg-quick up /home/purism/AirVPN/wg.conf"
StartupNotify=true
Terminal=false
Type=Application
Categories=Utilities;
Icon=/home/purism/.local/share/icons/WG_On.png
Save as "WG_Off.desktop"
:
[Desktop Entry]
Name=WG_Off
Exec=gnome-terminal -x bash -c "sudo wg-quick down /home/purism/AirVPN/wg.conf"
StartupNotify=true
Terminal=false
Type=Application
Categories=Utilities;
Icon=/home/purism/.local/share/icons/WG_Off.png
Don’t forget to change "AirVPN/wg.conf"
to match your own path, in both of the above applications.
Next, create or download two suitable images for the launcher icons. I drew these using the Drawing
application, and then cleaned them up in GIMP
:
WG_On.png
WG_Off.png
The icon file names must match the names as indicated in the application files, i.e. "WG_On.png"
and "WG_Off.png"
. You can use different names as long as the icons match the text in the application files exactly. (The artwork itself doesn’t need to match; I used “UP” and “Down” in the image instead of “On” and “Off,”, but the files where the icons are located are still named “WG_On.png
” and “WG_Off.png
”.)
Save the icons in .local/share/icons
. Create the folder if you don’t already have it from having created apps in the past.
The icons will now appear in the app grid. They can be moved to the favorites area up top if desired:
Tapping the icon, launches it:
Then your sudo
password is required:
Connection occurs immediately, as indicated by the “wg” toggle in the notifications area (also visible at the top of the home screen):
Note that tapping the wg toggle in the drop-down does sever the Wireguard connection, but doing it this way causes the Wireguard UP
launcher to fail on reconnect. Launching Wireguard Down
resets it so that the Wireguard Up
launcher works again.
Once connected, you can verify at a site such as AirVPN’s ipleak.net
:
(Hey, I’m not in Canada, eh?)