From b2b5d8643bd7184423889f9957c3828ec02142af Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Tue, 27 Jan 2026 15:17:16 +0300 Subject: [PATCH] fix(awg): reload wg0 interface after adding client to apply AWG params Without interface reload, AWG obfuscation params (Jc, S1, S2, H1-H4) are not applied to the kernel, and connections fail because client uses AWG but server uses standard WireGuard protocol. --- inc/VpnClient.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/VpnClient.php b/inc/VpnClient.php index 8c00874..77ff66a 100644 --- a/inc/VpnClient.php +++ b/inc/VpnClient.php @@ -902,6 +902,11 @@ class VpnClient // 5. Update clientsTable self::updateClientsTable($serverData, $publicKey, $clientIP); + + // 6. CRITICAL: Reload WG interface to apply AWG obfuscation params + // Without this, the interface uses standard WireGuard without Jc/S1/S2/H1-H4 + $cmd5 = sprintf("docker exec -i %s sh -c 'ip link del wg0 2>/dev/null || true; wg-quick up /opt/amnezia/awg/wg0.conf 2>&1'", $containerName); + self::executeServerCommand($serverData, $cmd5, true); } /**