[GH-ISSUE #5701] [Question]: i cant use wireguard on 3.4.2 #3964

Closed
opened 2026-10-31 20:36:12 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @usamirali on GitHub (Jun 30, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5701

What are you trying to do?

i create wireguard inbound and open port on udp and attach on client
but i cant connect to it
i test it on 4 server
i just created and attach to client

im wrong or i forgot somthing to do

What have you already tried?

No response

3x-ui version

3.4.2

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 26

Screenshots or config snippets

No response

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @usamirali on GitHub (Jun 30, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5701 ### What are you trying to do? i create wireguard inbound and open port on udp and attach on client but i cant connect to it i test it on 4 server i just created and attach to client im wrong or i forgot somthing to do ### What have you already tried? _No response_ ### 3x-ui version 3.4.2 ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 26 ### Screenshots or config snippets _No response_ ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 30, 2026):

A few separate things must all be in place for a WireGuard inbound to work; please check each one.

1. Confirm Xray started the inbound successfully

Open the panel → Logs tab (or run journalctl -u x-ui -f on the server) immediately after toggling the inbound on. If Xray failed to start the WireGuard listener you will see an error there. Common causes are a port conflict or, on some VPS providers, the kernel TUN device being unavailable (see point 4).

2. Verify the UDP port is actually listening

sudo ss -ulnp | grep <your_wg_port>

The port must appear in the output. If it does not, Xray either did not start cleanly or something else is holding the port.

3. Check how the client device was configured

3x-ui generates a wireguard:// share link for each client (confirmed in internal/sub/service.go). That link encodes the client's private key, the server's public key, the allocated tunnel address, MTU, and optional DNS. The recommended way to configure the connecting device is:

  • Open the client's row in the panel → copy the QR code or share link.
  • Import it into a standard WireGuard app (the official WireGuard app for Android/iOS/Windows/macOS, or wg-quick on Linux).

The share link is only generated when the client entry has a private key stored. If you added the client manually and left the key fields blank, the panel will not have a private key on file and the link will be empty. In that case, delete and re-add the client so the panel generates a fresh keypair automatically.

4. Enable "No-kernel TUN" if your VPS restricts TUN devices

3x-ui's WireGuard inbound runs through Xray-core's WireGuard proxy implementation, which by default tries to open a kernel TUN device (confirmed in frontend/src/schemas/protocols/inbound/wireguard.ts and internal/web/service/xray.go). Many cloud VPS providers (OpenVZ, some LXC containers, certain KVM images) do not expose /dev/net/tun.

To check:

ls -l /dev/net/tun

If that file is missing or returns "No such file or directory", open the inbound settings in the panel, enable No-kernel TUN (noKernelTun: true), save, and restart Xray. Without this the inbound silently fails to bind on affected hosts.

5. Firewall

Confirm the firewall (ufw, iptables, or your cloud provider's security group) allows inbound UDP on the WireGuard port.

sudo ufw status

To narrow down the issue further, please share:

  1. The relevant lines from the Xray log around the time you enable the inbound (any error mentioning wireguard or failed to listen).
  2. The output of sudo ss -ulnp | grep <port>.
  3. What client app you are using on the connecting device and whether you imported the config via QR/share link or entered it manually.
  4. Whether /dev/net/tun exists on your servers.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4847493080 --> @github-actions[bot] commented on GitHub (Jun 30, 2026): A few separate things must all be in place for a WireGuard inbound to work; please check each one. **1. Confirm Xray started the inbound successfully** Open the panel → Logs tab (or run `journalctl -u x-ui -f` on the server) immediately after toggling the inbound on. If Xray failed to start the WireGuard listener you will see an error there. Common causes are a port conflict or, on some VPS providers, the kernel TUN device being unavailable (see point 4). **2. Verify the UDP port is actually listening** ```bash sudo ss -ulnp | grep <your_wg_port> ``` The port must appear in the output. If it does not, Xray either did not start cleanly or something else is holding the port. **3. Check how the client device was configured** 3x-ui generates a `wireguard://` share link for each client (confirmed in `internal/sub/service.go`). That link encodes the client's private key, the server's public key, the allocated tunnel address, MTU, and optional DNS. The recommended way to configure the connecting device is: - Open the client's row in the panel → copy the QR code or share link. - Import it into a standard WireGuard app (the official WireGuard app for Android/iOS/Windows/macOS, or `wg-quick` on Linux). The share link is only generated when the client entry has a private key stored. If you added the client manually and left the key fields blank, the panel will not have a private key on file and the link will be empty. In that case, delete and re-add the client so the panel generates a fresh keypair automatically. **4. Enable "No-kernel TUN" if your VPS restricts TUN devices** 3x-ui's WireGuard inbound runs through Xray-core's WireGuard proxy implementation, which by default tries to open a kernel TUN device (confirmed in `frontend/src/schemas/protocols/inbound/wireguard.ts` and `internal/web/service/xray.go`). Many cloud VPS providers (OpenVZ, some LXC containers, certain KVM images) do not expose `/dev/net/tun`. To check: ```bash ls -l /dev/net/tun ``` If that file is missing or returns "No such file or directory", open the inbound settings in the panel, enable **No-kernel TUN** (`noKernelTun: true`), save, and restart Xray. Without this the inbound silently fails to bind on affected hosts. **5. Firewall** Confirm the firewall (ufw, iptables, or your cloud provider's security group) allows inbound UDP on the WireGuard port. ```bash sudo ufw status ``` --- To narrow down the issue further, please share: 1. The relevant lines from the Xray log around the time you enable the inbound (any error mentioning `wireguard` or `failed to listen`). 2. The output of `sudo ss -ulnp | grep <port>`. 3. What client app you are using on the connecting device and whether you imported the config via QR/share link or entered it manually. 4. Whether `/dev/net/tun` exists on your servers. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@dignatenkov commented on GitHub (Jul 1, 2026):

same problem

<!-- gh-comment-id:4853329661 --> @dignatenkov commented on GitHub (Jul 1, 2026): same problem
Author
Owner

@beevar-u commented on GitHub (Jul 1, 2026):

I can use wireguard (3x-ui in docker) with mobile client, but can't make mikrotik router working with it..

<!-- gh-comment-id:4859485648 --> @beevar-u commented on GitHub (Jul 1, 2026): I can use wireguard (3x-ui in docker) with mobile client, but can't make mikrotik router working with it..
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3964
No description provided.