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.
This commit is contained in:
1 parent
ddaf9360be
commit
3dae76c41a
1 file changed
+2
-2
+2
-2
@@ -623,8 +623,8 @@ class VpnClient
|
|||||||
$stmt->execute([$serverData['id']]);
|
$stmt->execute([$serverData['id']]);
|
||||||
$usedIPs = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
$usedIPs = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
||||||
|
|
||||||
// Reserve network address
|
// Reserve network address and server gateway (.1)
|
||||||
$used = ['10.8.1.0' => true];
|
$used = ['10.8.1.0' => true, '10.8.1.1' => true];
|
||||||
foreach ($usedIPs as $ip) {
|
foreach ($usedIPs as $ip) {
|
||||||
$used[$ip] = true;
|
$used[$ip] = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user