ngoduykhanh / wireguard-ui

Wireguard web interface
MIT License
3.78k stars 464 forks source link

Wireguard-ui Client issues #528

Open Blue-Comet opened 5 months ago

Blue-Comet commented 5 months ago

Hello, I installed Wireguard-ui, ran it, and succeeded in accessing the WEB UI.

If you create a user, download the conf file, and connect through the Wiregurd Client, there is no external network connection.

However, if you create a Wireguard Client directly on the server and download the conf file, you can connect normally.

What information do I need to get help and what should I do?

davidclaeysquinones commented 5 months ago

As far as I understand an user does not come with a conf file. These are two sepparate concepts, users are intended to acces the management UI while clients contain the necessary information to establish a remote connection. Right now admin users can change the server configuration and normal users just can edit clients. It would be nice to be able to link clients with a certain user but this functionality is currently not in the roadmap as far I understand.

nebulosa2007 commented 5 months ago

What information do I need to get help and what should I do?

Please show us these client .conf files with the removed PrivateKey and Endpoint fields.

Blue-Comet commented 5 months ago

Sorry, first of all, please forget about the Client conf file I mentioned before.

It's a guess, but I think I've found the cause.

When creating a user and applying in the Web UI, the Wiregurd daemon restarts and seems to be unable to read the contents of the /etc/wireguard/wg0.conf file.

If you create a user in the Web UI, apply it, and then run the systemctl restart wg-quick@wg0 command on the server, it seems to work normally.

Is it true that Apply on the Wireguard Clients page restarts the Wireguard daemon on the server backend?

Also add the client's conf file.

Wireguard-ui Version is "wireguard-ui-v0.6.2-linux-amd64.tar.gz"

[Interface]
PrivateKey = ~~~~
Address = 10.252.1.2/32
DNS = 8.8.8.8
MTU = 1450

[Peer]
PublicKey = ~~~~
PresharedKey =
AllowedIPs = 0.0.0.0/0
Endpoint = X.X.X.X:51820
PersistentKeepalive = 5
davidclaeysquinones commented 5 months ago
image

When using docker the WG daemon can be managed by Wireguard-UI. Otherwise you'll need to restart the daemon yourself.

Blue-Comet commented 5 months ago

I've already seen the settings, but I inquired just in case. They say it only works with Docker, so I'll try testing it with Docker.

Thanks for you Support ! :)

nebulosa2007 commented 5 months ago

Is it true that Apply on the Wireguard Clients page restarts the Wireguard daemon on the server backend?

Nope. It just saves wg0.conf file. But you can add and launch an additional service that monitoring the wg0.conf file and reloads wg

Blue-Comet commented 5 months ago

Currently, openrc is not installed on my server, and even if I want to install the related package, I cannot find it.

The version of my server is ubuntu 22.04, and the results of the apt command are also shared.

Am I the only one who has experienced this?

# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
# apt-cache search openrc
openrct2-objects - Object definitions for OpenRCT2
openrct2-title-sequences - Title sequences for OpenRCT2
# apt-get install openrc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package openrc is not available, but is referred to by another package.
This may mean that the package is missing, has been obsolete, or
is only available from another source

E: Package 'openrc' has no installation candidate
Blue-Comet commented 5 months ago

First of all, I made it so that it can be configured without openrc, and it may be an issue with my Linux Server.

Ultimately, it seems to work well even if it is not a Docker environment.

Thank you so much for kindly answering my questions. Thank you for your support, and I think we can close this issue.

nebulosa2007 commented 5 months ago

In what moment OpenRC appears? I use and talk about SystemD services. Ubuntu is using systemd as well. So you just need read instructions from this point and only for SystemD not for OpenRC.