DEV Community

Piotr Romańczuk
Piotr Romańczuk

Posted on • Edited on

One wireguard connection to solve two person's problems

Several years ago my uncle needed to start using e-mail. E-mail and simple one page text documents were supposed to be his only computer activities at that time.

I installed Linux Mint 13 Cinnamon 32 bit on my unused Thinkpad T61 and I gave it to him.
All was working without any hiccups. Recently his printer has died.
I visited him to install drivers and configure new printer. Unfortunately it was not so easy. Old Mint had no drivers for that very new Brother wi-fi printer. I managed to download and install it manualy via famous CUPS webpanel http://localhost:631

But the very next day ...

Uncle is calling:

  • Hi, my printer does not print.
  • Are there any messages on screen?
  • No.
  • What is the status of the printer in the printer panel?
  • Let me check ... oops ... I deleted it by mistake.

Did I mention that my uncle lives 40km from me?

New times, new challenges, new possibilities

My uncle said that he has another used laptop. He acquired it from someone in hope to be faster and usable with youtube and video conferencing. But this laptop has had Win10 on HDD. It was slow like hell!
And uncle doesn't want to learn Windows. He wants to feel at home with green folders of Linux Mint ;)

Decision made: Put SSD into that newer laptop. Install current Linux Mint Cinnamon 19.3 64bit. Copy all the data.

Easy peasy. Half an hour of work. But what about 40km? WireGurad!

Luckily I have working WireGuard installation on my OpenWRT 19.07 router.

Step by step instructions

For future me, if my aunt calls me with similar problem.

Generate wireguard keys pair

wg genkey | tee uncle-george.key | wg pubkey > uncle-george.pub
Enter fullscreen mode Exit fullscreen mode

Add wg peer on OpenWRT router

Network -> Interfaces -> Edit your WG interface -> Peers tab

Add peer button on the bottom
WG peer config

Save, Apply changes, restart WG interface

Remote access to ubuntu based desktop

apt install ssh
Enter fullscreen mode Exit fullscreen mode

Desktop sharing Linux Mint 19.3 Cinnamon

apt install vino dconf-editor
Enter fullscreen mode Exit fullscreen mode

Add vino-server to autosart

/usr/lib/vino/vino-server
Enter fullscreen mode Exit fullscreen mode

Because of cinnamon you have to use dconf to configure vino. Preferences does not work.

dconf path:

/org/gnome/desktop/remote‐access
Enter fullscreen mode Exit fullscreen mode

Install and configure WG on ubuntu based desktop

Linux mint 19.3, uncle's machine

apt install wireguard
Enter fullscreen mode Exit fullscreen mode

Add wg-qucik configuration file, i.e. /etc/wireguard/wg0.conf

[Interface]
Address = x.x.x.6/24
#here goes uncle private key
PrivateKey = OJBB**************************4W0o=

[Peer]
#here goes router public key
PublicKey = RpPL5n9bBX**************************mGzofYTFw=
Endpoint = 1.2.3.4:1234
PersistentKeepalive = 25
AllowedIPs = x.x.x.0/24, y.y.y.0/24
Enter fullscreen mode Exit fullscreen mode

enable and start wg service

sudo systemctl enable wg-quick@wg0.service
sudo systemctl daemon-reload
sudo systemctl start wg-quick@wg0
Enter fullscreen mode Exit fullscreen mode

wg-quick automatically adds routes for all AllowedIPs

Top comments (0)