From 2ede16075e44555366d10103e26816d3a864cd9c Mon Sep 17 00:00:00 2001 From: randomshell <43271778+randomshell@users.noreply.github.com> Date: Thu, 2 Apr 2020 16:23:05 +0000 Subject: [PATCH] Use a random port for Wireguard server --- wireguard-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index d012de2..4221da6 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -52,7 +52,8 @@ read -rp "Server's WireGuard IPv4 " -e -i "$SERVER_WG_IPV4" SERVER_WG_IPV4 SERVER_WG_IPV6="fd42:42:42::1" read -rp "Server's WireGuard IPv6 " -e -i "$SERVER_WG_IPV6" SERVER_WG_IPV6 -SERVER_PORT=51820 +# Generate random number within private ports range +SERVER_PORT=$(shuf -i49152-65535 -n1) read -rp "Server's WireGuard port " -e -i "$SERVER_PORT" SERVER_PORT CLIENT_WG_IPV4="10.66.66.2"