From 02e23c0786a723ab1207e00eb3f0d31acc43121d Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sat, 22 Apr 2023 17:05:00 +0900 Subject: [PATCH] Update wireguardConfigGenerator.sh Do not use ip address that is the subnet broadcast address. --- wireguardConfigGenerator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wireguardConfigGenerator.sh b/wireguardConfigGenerator.sh index fa4e76a..e6f51f4 100755 --- a/wireguardConfigGenerator.sh +++ b/wireguardConfigGenerator.sh @@ -123,7 +123,7 @@ elif (( $WG_SUBNET > 24 )); then USED_BITS=$(( $USED_BITS - 1 )) done - CLIENT_COUNT=$(( 2**(32 - $WG_SUBNET) - 2 )) + CLIENT_COUNT=$(( 2**(32 - $WG_SUBNET) - 2 - 1 )) fi echo "Creating config with name \"$WGNAME\" with \"$CLIENT_COUNT\" clients and subnet \"$WG_SUBNET\"..."