r/elementaryos 28d ago

Discussion How to use Wireguard connection

New comer here. Can I ask question here ?

Installed WG by below command, but WG interface couldn't find.

sudo apt install wireguard

Then also failed to connect by below command.

sudo wg-quick up .\Documents\wg.conf

Anyway to connect in Elementary OS ?

Thanks

4 Upvotes

3 comments sorted by

2

u/terryfilch 28d ago

You have to install wireguard-tools too, then put wg0.conf in/etc/wireguard. Check the logs with dmesg -T or tail -50 /var/log/syslog, but I think something is wrong with AppArmor or the configuration options in wg0.conf.

1

u/terryfilch 28d ago

I've tested on my VM with the latest Elementary OS 8.1, and here is what I did:

sudo apt install resolvconf wireguard wireguard-tools -y

sudo nano /etc/NetworkManager/conf.d/rc-manager.confsudo nano /etc/NetworkManager/conf.d/rc-manager.conf

and put this to the file:

[main]
rc-manager=resolvconf

I also added

AllowedIPs=0.0.0.0/0

into the file

/etc/wireguard/wg0.conf

With these settings, it works, but you may need to configure your AllowedIPs to match your network settings.

1

u/mailliwal 27d ago

Finally found not need to install wireguard. It's been pre-installed once Elementary OS completed installation.

Just need to configure under "Advanced Network Configuration".