# \[WireGuard\] Virtual Private Network

**URL:** <https://forum.yunohost.org/t/wireguard-virtual-private-network/12928>\
**Category:** Apps\
**Tags:** wireguard\
**Created:** [October 11, 2020, 5:18pm UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928 "2020-10-11T17:18:13Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [March 2, 2021, 4:57pm UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/41 "2021-03-02T16:57:22Z")

</div>

Solution found, and first post updated. Thanks for your feedback!

(it was the port forwarding being disabled in `sysctl.conf`)

---

<div class="post-metadata">

**Author:** ![mabra70](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mabra70/32/1864_2.png) [@mabra70](https://forum.yunohost.org/u/mabra70)\
**Post date:** [March 21, 2021, 6:04pm UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/42 "2021-03-21T18:04:47Z")

</div>

I hope to be of help to someone:  
on my Yunohost installation I also had to uncomment “net.ipv6.conf.all.forwarding = 1” to be able to access the internet via the VPN.

Thanks to all of you, with your comments I was able to create my own unlimited and private VPN on my VPS.

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [March 21, 2021, 11:14pm UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/43 "2021-03-21T23:14:54Z")

</div>

Oh right, thanks! I have updated the instructions. 😉

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [March 23, 2021, 4:12pm UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/44 "2021-03-23T16:12:03Z")

</div>

Hello all,

> **Testing summary**
>
> A [testing release](https://github.com/YunoHost-Apps/wireguard_ynh/pull/16) is available for wireguard\_ynh! Follow the instructions on the first post of the thread to know how to test it, feedback is most welcome.
> 
> Merging in 3 days if no critical error is reported. 🚀
> 
> * * *

2021-03-31: A new release for wireguard\_ynh is available:

- Adding the repository GPG key to ease the installation
- Remove prompt for path, since it can only be installed at the root of a domain so far
- Cleanup all the services installed by the app (now you should have one for the UI as before, and one for the VPN itself that should appear actually running).

Enjoy!

---

<div class="post-metadata">

**Author:** ![Mamie](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mamie/32/1245_2.png) [@Mamie](https://forum.yunohost.org/u/Mamie)\
**Post date:** [April 4, 2021, 10:16am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/45 "2021-04-04T10:16:12Z")

</div>

Impossible to upgrade, due to backup failed (nothing to backup)

Here is the log : [https://paste.yunohost.org/raw/eqovovuheb](https://paste.yunohost.org/raw/eqovovuheb)

(I’ll uninstall and reinstall)

---

<div class="post-metadata">

**Author:** ![dcba](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@dcba](https://forum.yunohost.org/u/dcba)\
**Post date:** [April 5, 2021, 8:08am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/46 "2021-04-05T08:08:42Z")

</div>

Hello, I want to try wireguard on yunohost so I have to :

- install the app with yh graphic interface
- open the yunohost firewall on the port xxx(?)
- enable port forwarding in /etc/sysctl.conf and postup script and postdown scripts

Is that it ?

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [April 5, 2021, 10:49am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/47 "2021-04-05T10:49:33Z")

</div>

Yes to all, except:

> [@dcba](#):
>
> - open the yunohost firewall on the port xxx(?)

WireGuard’s port is automatically opened on YunoHost’s side. However if you are self-hosting at home, you will need to open and forward this same port to your server in your modem.

---

<div class="post-metadata">

**Author:** ![cousiyou](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cousiyou](https://forum.yunohost.org/u/cousiyou)\
**Post date:** [April 5, 2021, 11:01am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/48 "2021-04-05T11:01:11Z")

</div>

installation sans probleme.Merci

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [April 5, 2021, 11:03am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/49 "2021-04-05T11:03:12Z")

</div>

> [@Mamie](#):
>
> Impossible to upgrade, due to backup failed (nothing to backup)
> 
> Here is the log : [https://paste.yunohost.org/raw/eqovovuheb](https://paste.yunohost.org/raw/eqovovuheb)
> 
> (I’ll uninstall and reinstall)

Thanks for the report! Had you tried a testing version, or a partial upgrade beforehand? This file no longer exists in the new version, but it should be here in the older ones.

If something similar happens to someone else, do not hesitate to report it.  
Meanwhile, you can also add `--not_mandatory` after `ynh_backup --src_path=/etc/systemd/system/wireguard.path` and similar lines into `/etc/yunohost/apps/wireguard/scripts/backup` and `restore`.

---

<div class="post-metadata">

**Author:** ![dcba](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@dcba](https://forum.yunohost.org/u/dcba)\
**Post date:** [April 5, 2021, 12:02pm UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/50 "2021-04-05T12:02:47Z")

</div>

I’ve installed wiregard with yunohost but wg0 was missing and modprobe didnt found wireguard.

After ,

`sudo apt-get install linux-headers-$(uname -r)`  
`sudo wg-quick up wg0`

It worked.

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [April 5, 2021, 7:43pm UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/51 "2021-04-05T19:43:15Z")

</div>

Hello, thanks for the report! I was about to add this dependency manually in a previous version, but I thought the dependency was always added by WireGuard.

What is your system architecture?

---

<div class="post-metadata">

**Author:** ![dcba](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@dcba](https://forum.yunohost.org/u/dcba)\
**Post date:** [April 11, 2021, 2:56pm UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/52 "2021-04-11T14:56:47Z")

</div>

VPS debian

---

<div class="post-metadata">

**Author:** ![arkadi](https://forum.yunohost.org/user_avatar/forum.yunohost.org/arkadi/32/5350_2.png) [@arkadi](https://forum.yunohost.org/u/arkadi)\
**Post date:** [April 15, 2021, 7:19am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/53 "2021-04-15T07:19:32Z")

</div>

Silly question, how do I get a Linux client to work with this. I tried this:

```
$ wg setconf wg0 wg0.conf      
Line unrecognized: `Address=10.10.10.1/32'
Configuration parsing error

```

But it didn’t like it.

I also tried using Wireguard on Android with the QR code, but I use LineageOS with no Google services so maybe something is causing it to not work there. It keeps trying to handshake.

Wireguard always makes me feel stupid ☹

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [April 15, 2021, 7:28am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/54 "2021-04-15T07:28:19Z")

</div>

> [@arkadi](#):
>
> Wireguard always makes me feel stupid ☹

Me too… it is always trial and error with this app. 😕

First can you check that your VPN server is actually running with `sudo wg`?  
Then on you clients, copy the `xg0.conf` file in `/etc/wireguard/`, then you can use `sudo wg-quick up wg0`

Your lack of handshake makes me think the server is not running, hence the first check. 😉

---

<div class="post-metadata">

**Author:** ![Mamie](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mamie/32/1245_2.png) [@Mamie](https://forum.yunohost.org/u/Mamie)\
**Post date:** [April 15, 2021, 8:11am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/55 "2021-04-15T08:11:51Z")

</div>

> [@arkadi](#):
>
> I also tried using Wireguard on Android with the QR code, but I use LineageOS with no Google services so maybe something is causing it to not work there. It keeps trying to handshake.

Same env here too, this is not due to the lack of Google.  
I had the same exact problem with handshake.  
And it was solved, I do not remember how.  
I recently re-installed the app and now I have the handshake problem again.

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [April 15, 2021, 8:18am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/56 "2021-04-15T08:18:33Z")

</div>

I will run some more tests, I think it is linked to the fact I want all commands to be run by the `wireguard` user, while some seem to require root.

---

<div class="post-metadata">

**Author:** ![arkadi](https://forum.yunohost.org/user_avatar/forum.yunohost.org/arkadi/32/5350_2.png) [@arkadi](https://forum.yunohost.org/u/arkadi)\
**Post date:** [April 15, 2021, 8:49am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/57 "2021-04-15T08:49:11Z")

</div>

regarding the Android handshake issue:

```
[253888342,com.wireguard.android.activity.SettingsActivity,RESUME_ACTIVITY]
04-15 15:37:36.144 29478 29478 I wm_on_top_resumed_gained_called: [253888342,com.wireguard.android.activity.SettingsActivity,topStateChangedWhenResumed]
04-15 15:37:36.668 29478 29478 I wm_on_stop_called: [139448018,com.wireguard.android.activity.MainActivity,STOP_ACTIVITY_ITEM]
04-15 15:37:40.083 29478 29478 I wm_on_top_resumed_lost_called: [253888342,com.wireguard.android.activity.SettingsActivity,topStateChangedWhenResumed]
04-15 15:37:40.090 29478 29478 I wm_on_paused_called: [253888342,com.wireguard.android.activity.SettingsActivity,performPause]
04-15 15:37:40.123 29478 29478 I wm_on_create_called: [163269339,com.wireguard.android.activity.LogViewerActivity,performCreate]
04-15 15:37:40.125 29478 29478 I wm_on_start_called: [163269339,com.wireguard.android.activity.LogViewerActivity,handleStartActivity]
04-15 15:37:40.126 29478 29478 I wm_on_resume_called: [163269339,com.wireguard.android.activity.LogViewerActivity,RESUME_ACTIVITY]
04-15 15:37:40.130 1433 1433 I auditd : type=1400 audit(0.0:2703): avc: denied { read } for comm="logcat" name="secd" dev="mmcblk0p43" ino=943 scontext=u:r:untrusted_app:s0:c208,c256,c512,c768 tcontext=u:object_r:secd_exec:s0 tclass=file permissive=0 app=com.wireguard.android
04-15 15:37:40.137 29478 29478 I wm_on_top_resumed_gained_called: [163269339,com.wireguard.android.activity.LogViewerActivity,topStateChangedWhenResumed]
04-15 15:37:40.656 29478 29478 I wm_on_stop_called:

```

This looks like some sort of permission problem maybe?

`04-15 15:37:40.130 1433 1433 I auditd : type=1400 audit(0.0:2703): avc: denied { read } for comm="logcat" name="secd" dev="mmcblk0p43" ino=943 scontext=u:r:untrusted_app:s0:c208,c256,c512,c768 tcontext=u:object_r:secd_exec:s0 tclass=file permissive=0 app=com.wireguard.android`

EDIT: It is working. Android/LineageOS all A-OK with Wireguard.

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [April 15, 2021, 9:51am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/58 "2021-04-15T09:51:04Z")

</div>

Can you run the command `sudo wg` _on the server_? 😇

---

<div class="post-metadata">

**Author:** ![arkadi](https://forum.yunohost.org/user_avatar/forum.yunohost.org/arkadi/32/5350_2.png) [@arkadi](https://forum.yunohost.org/u/arkadi)\
**Post date:** [April 15, 2021, 10:00am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/59 "2021-04-15T10:00:08Z")

</div>

Ah everything is working now! Even on my phone.

Didn’t know to put the wg0.conf file in /etc/wireguard. Thank you!

Also it was a rookie move to forget to open router port 😑

Wow this app makes Wireguard so accessible! Thanks so much!

To test it was working, I just did [ipleak.net](http://ipleak.net) before and after using wireguard. With wireguard i have the same address as my home internet/server internet. i can also web browse on my phone with no problems.

are there other tests we should be doing to ensure everything is working properly?

---

<div class="post-metadata">

**Author:** ![Mamie](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mamie/32/1245_2.png) [@Mamie](https://forum.yunohost.org/u/Mamie)\
**Post date:** [April 15, 2021, 10:06am UTC](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928/60 "2021-04-15T10:06:20Z")

</div>

Still not working on my side (phone only, so I did not try to use the wg0.conf file as it seems to be for client only)

```auto
sudo wg
  public key: TLApL5dllCQQN/+kFrSBxxPaYN1VG35uYygXDp7GMRY=
  private key: (hidden)
  listening port: 8095

```

I tried to restart the wg-quick@wg service, and yunohost-firewall, but still no handshake.

And I still have a wireguard service listed, unknown to the system, that was still here when my old installation was removed.  
`Failed to get status information via dbus for service wireguard, systemctl didn't recognize this service ('NoSuchUnit').`

[Previous page](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928.md?page=2)

[Next page](https://forum.yunohost.org/t/wireguard-virtual-private-network/12928.md?page=4)
