From 3dae76c41aaf1c599f384f8dce731af87db0340c Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Tue, 27 Jan 2026 15:12:49 +0300 Subject: [PATCH] fix(awg): reserve server gateway IP (.1) in client IP assignment Previously only .0 was reserved, causing first client to get 10.8.1.1 (server IP). Now both .0 and .1 are reserved, clients start from 10.8.1.2. --- inc/VpnClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/VpnClient.php b/inc/VpnClient.php index a61def2..8c00874 100644 --- a/inc/VpnClient.php +++ b/inc/VpnClient.php @@ -623,8 +623,8 @@ class VpnClient $stmt->execute([$serverData['id']]); $usedIPs = $stmt->fetchAll(PDO::FETCH_COLUMN); - // Reserve network address - $used = ['10.8.1.0' => true]; + // Reserve network address and server gateway (.1) + $used = ['10.8.1.0' => true, '10.8.1.1' => true]; foreach ($usedIPs as $ip) { $used[$ip] = true; }