[GH-ISSUE #6955] [Question]: AmneziaWG 3,1 исходящее соединение #4597

Open
opened 2026-10-31 20:40:47 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @leshik791644 on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6955

What are you trying to do?

I have an Amnezia VPN (WireGuard-based) subscription, and I’ve configured outbound connections to various countries via the control panel. Well, it stopped working today; Amnezia’s technical support claims they’ve updated their protocols and that version 3.1 is now required—the latest version of 3x-ui does support Amnezia 3.1.

у меня куплен впн амнезия вг, и через панель настроены исходящие подключеия в разные страны, так вот сегодня перестала работать, ТП амнезии заявляет что они обновили протоколы и нужен 3.1 - сейчас в новой версии 3x ui поддерживается Амнзеия 3.1

What have you already tried?

No response

3x-ui version

3.11.0

How did you install 3x-ui?

install.sh script

Operating system

No response

Screenshots or config snippets

Image

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 @leshik791644 on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6955 ### What are you trying to do? I have an Amnezia VPN (WireGuard-based) subscription, and I’ve configured outbound connections to various countries via the control panel. Well, it stopped working today; Amnezia’s technical support claims they’ve updated their protocols and that version 3.1 is now required—the latest version of 3x-ui does support Amnezia 3.1. у меня куплен впн амнезия вг, и через панель настроены исходящие подключеия в разные страны, так вот сегодня перестала работать, ТП амнезии заявляет что они обновили протоколы и нужен 3.1 - сейчас в новой версии 3x ui поддерживается Амнзеия 3.1 ### What have you already tried? _No response_ ### 3x-ui version 3.11.0 ### How did you install 3x-ui? install.sh script ### Operating system _No response_ ### Screenshots or config snippets <img width="2145" height="1156" alt="Image" src="https://github.com/user-attachments/assets/67c1c5df-63be-4e65-b921-a90bb1967a20" /> ### 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 (Oct 26, 2026):

Да, 3x-ui 3.11.0 умеет подключаться к серверу AmneziaWG 3.1 как к исходящему соединению. Но для этого нужен отдельный тип исходящего amneziawg, а не обычный wireguard, и в него нужно перенести все новые параметры из обновлённого .conf от вашего провайдера.

Скриншот я открыть не могу, поэтому не вижу, какой тип исходящего у вас сейчас выбран.

Что сделать

  1. Скачайте у провайдера Amnezia новый конфиг (.conf) для каждой страны. Старые значения обфускации после их обновления больше не подходят.
  2. Откройте в панели Xray Configs → Outbounds, затем создайте исходящее (или измените существующее) с протоколом amneziawg. Обычный протокол wireguard в Xray не передаёт параметры обфускации Amnezia, поэтому сервер AmneziaWG его соединение не примет.
  3. Перенесите значения из .conf в одноимённые поля:
    • [Interface]: PrivateKey → Private key; Address → Address; DNS → DNS; MTU → MTU (можно оставить 0, тогда панель подберёт значение сама);
    • Jc, Jmin, Jmax, S1, S2, S3, S4, H1–H4 (в 3.1 это могут быть диапазоны вида 100-800), I1–I5: значения копируются как есть, один к одному;
    • [Peer]: Endpoint, PublicKey, PresharedKey → PSK, AllowedIPs, PersistentKeepalive → Keep alive.
  4. Сохраните настройки и перезапустите Xray.

При сохранении панель проверяет значения, и если что-то не так, она покажет ошибку. Например: invalid S4 value … (must be 0..32), invalid S1/S2: S1+56 must not equal S2, invalid H1: …, invalid I1: ….

Если после этого не заработает, пришлите текстом:

  1. Какой протокол у этого исходящего (wireguard или amneziawg) и его JSON (Outbounds → Edit). Ключи secretKey, presharedKey и headerProtectionKey замажьте. JSON покажет, дошли ли все 3.1-параметры до панели.
  2. Строки ошибок, которые панель выводит при сохранении, или вывод x-ui log / окно логов AmneziaWG на главной странице. По ним видно, на каком шаге рвётся соединение: при применении настроек или при рукопожатии с сервером.

Как это устроено в коде

  • Тип amneziawg для исходящего: frontend/src/schemas/protocols/outbound/amneziawg.ts:14-49 и internal/amneziawg/outbound.go:39-75. Там есть все поля 3.1: s3, s4, h1–h4 в виде строк-диапазонов, i1–i5, headerProtectionKey, contentPaddingAddition.
  • В Xray такое исходящее подставляется как SOCKS-мост ("swapped for a socks bridge at config generation", amneziawg.ts:3-4). Сам туннель поднимает встроенный amneziawg-go (internal/amneziawgnet/outbound_manager.go), а не Xray.
  • Проверка параметров при сохранении: ValidateAmneziaWGOutbound (internal/amneziawg/outbound.go:258) → ValidateObfuscation (internal/amneziawg/params.go:168).

Verdict: Not a bug (user configuration). Скорее всего, исходящие нужно пересоздать с типом amneziawg и новыми параметрами 3.1. Точно подтвердить это можно будет по JSON исходящего, о котором я прошу выше.

Этот ответ сгенерирован автоматически; мейнтейнер может дополнить его.

<!-- gh-comment-id:6415492306 --> @github-actions[bot] commented on GitHub (Oct 26, 2026): Да, 3x-ui 3.11.0 умеет подключаться к серверу AmneziaWG 3.1 как к исходящему соединению. Но для этого нужен отдельный тип исходящего `amneziawg`, а не обычный `wireguard`, и в него нужно перенести **все** новые параметры из обновлённого `.conf` от вашего провайдера. Скриншот я открыть не могу, поэтому не вижу, какой тип исходящего у вас сейчас выбран. **Что сделать** 1. Скачайте у провайдера Amnezia **новый** конфиг (`.conf`) для каждой страны. Старые значения обфускации после их обновления больше не подходят. 2. Откройте в панели **Xray Configs → Outbounds**, затем создайте исходящее (или измените существующее) с протоколом **`amneziawg`**. Обычный протокол `wireguard` в Xray не передаёт параметры обфускации Amnezia, поэтому сервер AmneziaWG его соединение не примет. 3. Перенесите значения из `.conf` в одноимённые поля: - `[Interface]`: `PrivateKey` → Private key; `Address` → Address; `DNS` → DNS; `MTU` → MTU (можно оставить `0`, тогда панель подберёт значение сама); - `Jc`, `Jmin`, `Jmax`, `S1`, `S2`, `S3`, `S4`, `H1`–`H4` (в 3.1 это могут быть диапазоны вида `100-800`), `I1`–`I5`: значения копируются как есть, один к одному; - `[Peer]`: `Endpoint`, `PublicKey`, `PresharedKey` → PSK, `AllowedIPs`, `PersistentKeepalive` → Keep alive. 4. Сохраните настройки и перезапустите Xray. При сохранении панель проверяет значения, и если что-то не так, она покажет ошибку. Например: `invalid S4 value … (must be 0..32)`, `invalid S1/S2: S1+56 must not equal S2`, `invalid H1: …`, `invalid I1: …`. **Если после этого не заработает, пришлите текстом:** 1. Какой протокол у этого исходящего (`wireguard` или `amneziawg`) и его JSON (Outbounds → Edit). Ключи `secretKey`, `presharedKey` и `headerProtectionKey` замажьте. JSON покажет, дошли ли все 3.1-параметры до панели. 2. Строки ошибок, которые панель выводит при сохранении, или вывод `x-ui log` / окно логов AmneziaWG на главной странице. По ним видно, на каком шаге рвётся соединение: при применении настроек или при рукопожатии с сервером. **Как это устроено в коде** - Тип `amneziawg` для исходящего: `frontend/src/schemas/protocols/outbound/amneziawg.ts:14-49` и `internal/amneziawg/outbound.go:39-75`. Там есть все поля 3.1: `s3`, `s4`, `h1`–`h4` в виде строк-диапазонов, `i1`–`i5`, `headerProtectionKey`, `contentPaddingAddition`. - В Xray такое исходящее подставляется как SOCKS-мост (`"swapped for a socks bridge at config generation"`, `amneziawg.ts:3-4`). Сам туннель поднимает встроенный amneziawg-go (`internal/amneziawgnet/outbound_manager.go`), а не Xray. - Проверка параметров при сохранении: `ValidateAmneziaWGOutbound` (`internal/amneziawg/outbound.go:258`) → `ValidateObfuscation` (`internal/amneziawg/params.go:168`). Verdict: Not a bug (user configuration). Скорее всего, исходящие нужно пересоздать с типом `amneziawg` и новыми параметрами 3.1. Точно подтвердить это можно будет по JSON исходящего, о котором я прошу выше. _Этот ответ сгенерирован автоматически; мейнтейнер может дополнить его._ <!-- claude-issue:analyst -->
Author
Owner

@leshik791644 commented on GitHub (Oct 26, 2026):

на последней прошивки - стало очень плохо рабоать исходящий AWG на амнзеию

<!-- gh-comment-id:6415995862 --> @leshik791644 commented on GitHub (Oct 26, 2026): на последней прошивки - стало очень плохо рабоать исходящий AWG на амнзеию
Author
Owner

@leshik791644 commented on GitHub (Oct 26, 2026):

{
"protocol": "amneziawg",
"settings": {
"secretKey": "0I2UKuvt1ig3Ei+/ggGxbfSBkM=",
"address": [
"100.101.230.35/32"
],
"jc": 6,
"jmin": 10,
"jmax": 80,
"s1": 856,
"s2": 61,
"s3": 766,
"s4": 12,
"h1": "1",
"h2": "2",
"h3": "3",
"h4": "4",
"randomTrailers": false,
"disableCookies": true,
"peers": [
{
"publicKey": "nbG15bFgLPy53x6RIuZY
BmQACDsG0=",
"presharedKey": "gPMtIRSLlcc8LcGlhbj*UPny45gH3A=",
"allowedIPs": [
"0.0.0.0/0",
"::/0"
],
"endpoint": "78.17.148.241:9911",
"keepAlive": 25
}
],
"i1": "<r 2><b 0x010000010000000000000259610272550000010001>",
"headerProtectionKey": "EKo3ntQvkKcFnw
XmJcVI74//+xgng=",
"contentPaddingAddition": "10-100"
},
"tag": "AWG3-FIN"
}

<!-- gh-comment-id:6418132663 --> @leshik791644 commented on GitHub (Oct 26, 2026): { "protocol": "amneziawg", "settings": { "secretKey": "0I2UKuvt********1ig3Ei+/ggGxbfSBkM=", "address": [ "100.101.230.35/32" ], "jc": 6, "jmin": 10, "jmax": 80, "s1": 856, "s2": 61, "s3": 766, "s4": 12, "h1": "1", "h2": "2", "h3": "3", "h4": "4", "randomTrailers": false, "disableCookies": true, "peers": [ { "publicKey": "nbG15bFgLPy53x6RIuZY********BmQACDsG0=", "presharedKey": "gPMtIRSLlcc8LcGlhbj******UPny45gH3A=", "allowedIPs": [ "0.0.0.0/0", "::/0" ], "endpoint": "78.17.148.241:9911", "keepAlive": 25 } ], "i1": "<r 2><b 0x010000010000000000000259610272550000010001>", "headerProtectionKey": "EKo3ntQvkKcFnw*****XmJcVI74//+xgng=", "contentPaddingAddition": "10-100" }, "tag": "AWG3-FIN" }
Author
Owner

@leshik791644 commented on GitHub (Oct 26, 2026):

секретные ключи я изменил, так как публичное сообщение

<!-- gh-comment-id:6418148257 --> @leshik791644 commented on GitHub (Oct 26, 2026): секретные ключи я изменил, так как публичное сообщение
Author
Owner

@AdLf0208 commented on GitHub (Oct 26, 2026):

I have an android client and config which is generated via 3x-ui subscription system and awg inbound is working flawlessly. The same goes for throne desktop client. But when it comes to outbound configuration on my personal home server(I route traffic to the xray via PBR and tun2socks) the outbound doesn't seem to work as in the presented issue . It tries to make a connection but maybe some field didn't get parsed correctly or whatnot but for me the 3x-ui outbound doesn't connect to awg 3.1 whereas awg 2.0 works fine (WARP via awg 2.0)

P.S.

Found out that these params are not present in the GUI. So maybe issue is related to this. Idk, maybe awg core itself knows about existence of these fields but if not, then that's definitely the culprit

Image

Only these one is present: (although when added, fields which are not the part of the interface are still present in the JSON config, so parser then thinks it's a correct config)

Image
<!-- gh-comment-id:6422945982 --> @AdLf0208 commented on GitHub (Oct 26, 2026): I have an android client and config which is generated via 3x-ui subscription system and awg inbound is working flawlessly. The same goes for throne desktop client. But when it comes to outbound configuration on my personal home server(I route traffic to the xray via PBR and tun2socks) the outbound doesn't seem to work as in the presented issue . It tries to make a connection but maybe some field didn't get parsed correctly or whatnot but for me the 3x-ui outbound doesn't connect to awg 3.1 whereas awg 2.0 works fine (WARP via awg 2.0) P.S. Found out that these params are not present in the GUI. So maybe issue is related to this. Idk, maybe awg core itself knows about existence of these fields but if not, then that's definitely the culprit <img width="324" height="156" alt="Image" src="https://github.com/user-attachments/assets/2a1ea74d-427a-4554-8811-e471444a449e" /> Only these one is present: (although when added, fields which are not the part of the interface are still present in the JSON config, so parser then thinks it's a correct config) <img width="677" height="137" alt="Image" src="https://github.com/user-attachments/assets/86763520-0419-4bd6-8917-f4842e121d8e" />
Author
Owner

@prmths-bot commented on GitHub (Oct 26, 2026):

Description of the Bug of Amnezia.

In a Multi-Node (Master-Node) cluster architecture, WireGuard and AmneziaWG client keypairs become desynchronized between the Master panel and the Node instances.

When an AmneziaWG/WireGuard inbound is created or assigned to a Node via the Master panel, the Master web interface exports client configuration files containing a PrivateKey that does not correspond to the PublicKey stored in the local SQLite database of the Node. As a consequence, the Node silently drops the client's handshake packets (Silent Drop), preventing connection until the keys are manually synced directly via the Node's database.


Steps to Reproduce

  1. Configure a 3x-ui cluster with a Master node (Server A) and an external Node (Server B).
  2. Create an AmneziaWG (or WireGuard) inbound assigned to Node (Server B).
  3. Add a client (e.g., client with auto-generated keys or matching UUID/subId from Master).
  4. Export the client configuration via QR code or file from the Master panel interface.
  5. Inspect the SQLite databases:
    • On Master (Server A): json_extract(settings, '$.clients[0].privateKey')
    • On Node (Server B): json_extract(settings, '$.clients[0].publicKey')
  6. Observe that the client's PrivateKey exported by the Master does not match the cryptographic pair of the PublicKey registered in the Node's runtime config/DB.
  7. Attempt connection: the Node receives incoming UDP packets (observable via tcpdump), but returns 0 responses (Out: 0) due to handshake decryption failure.

Expected Behavior

When exporting a client profile for an inbound assigned to an external Node, the Master panel must retrieve and provide the exact PrivateKey associated with that specific Node's registered client PublicKey.

Alternatively, the Master-Node sync routine should strictly propagate the Master's generated client keypair (privateKey and publicKey) to the Node's local database during inbound synchronization.


Actual Behavior

The Master panel's config generator defaults to an internal/unmatched client privateKey (or duplicates keys from the Master's local inbounds), while the Node either generates an independent keypair or retains an out-of-sync publicKey.

This leads to a silent handshake rejection on all Node-bound WireGuard/AmneziaWG inbounds exported from the primary panel.

<!-- gh-comment-id:6424865241 --> @prmths-bot commented on GitHub (Oct 26, 2026): ### Description of the Bug of Amnezia. In a Multi-Node (Master-Node) cluster architecture, WireGuard and AmneziaWG client keypairs become desynchronized between the Master panel and the Node instances. When an AmneziaWG/WireGuard inbound is created or assigned to a Node via the Master panel, the Master web interface exports client configuration files containing a `PrivateKey` that does not correspond to the `PublicKey` stored in the local SQLite database of the Node. As a consequence, the Node silently drops the client's handshake packets (`Silent Drop`), preventing connection until the keys are manually synced directly via the Node's database. --- ### Steps to Reproduce 1. Configure a 3x-ui cluster with a Master node (Server A) and an external Node (Server B). 2. Create an AmneziaWG (or WireGuard) inbound assigned to Node (Server B). 3. Add a client (e.g., client with auto-generated keys or matching UUID/subId from Master). 4. Export the client configuration via QR code or file from the Master panel interface. 5. Inspect the SQLite databases: - On Master (`Server A`): `json_extract(settings, '$.clients[0].privateKey')` - On Node (`Server B`): `json_extract(settings, '$.clients[0].publicKey')` 6. Observe that the client's `PrivateKey` exported by the Master does not match the cryptographic pair of the `PublicKey` registered in the Node's runtime config/DB. 7. Attempt connection: the Node receives incoming UDP packets (observable via `tcpdump`), but returns 0 responses (`Out: 0`) due to handshake decryption failure. --- ### Expected Behavior When exporting a client profile for an inbound assigned to an external Node, the Master panel must retrieve and provide the exact `PrivateKey` associated with that specific Node's registered client `PublicKey`. Alternatively, the Master-Node sync routine should strictly propagate the Master's generated client keypair (`privateKey` and `publicKey`) to the Node's local database during inbound synchronization. --- ### Actual Behavior The Master panel's config generator defaults to an internal/unmatched client `privateKey` (or duplicates keys from the Master's local inbounds), while the Node either generates an independent keypair or retains an out-of-sync `publicKey`. This leads to a silent handshake rejection on all Node-bound WireGuard/AmneziaWG inbounds exported from the primary panel.
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#4597
No description provided.