From fd2a7e94048f2e82058093e7e811792a5bfaf774 Mon Sep 17 00:00:00 2001 From: chipmunk <65827213+chipmunkmc@users.noreply.github.com> Date: Sat, 12 Oct 2024 23:55:51 -0400 Subject: [PATCH] Randomize port (part 2) --- config/iptables | 8 ++++---- script/alivecheck.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/iptables b/config/iptables index 0c8b7e6..3279ec8 100644 --- a/config/iptables +++ b/config/iptables @@ -1,11 +1,11 @@ # IPv4 -iptables -t nat -A INPUT -p tcp --dport 25565 -j SNAT --to-source 192.168.1.0-192.168.100.100 +iptables -t nat -A INPUT -p tcp --dport 17891 -j SNAT --to-source 192.168.1.0-192.168.100.100 iptables -t nat -A INPUT -p udp --dport 19132 -j SNAT --to-source 192.168.1.0-192.168.100.100 -iptables -A INPUT -p tcp --syn --dport 25565 -m connlimit --connlimit-above 5 --connlimit-mask 32 -j REJECT --reject-with tcp-reset +iptables -A INPUT -p tcp --syn --dport 17891 -m connlimit --connlimit-above 5 --connlimit-mask 32 -j REJECT --reject-with tcp-reset iptables-save > /etc/iptables/rules.v4 # IPv6 -ip6tables -t nat -A INPUT -p tcp --dport 25565 -j SNAT --to-source 2001:db8::1-2001:db8::6464 +ip6tables -t nat -A INPUT -p tcp --dport 17891 -j SNAT --to-source 2001:db8::1-2001:db8::6464 ip6tables -t nat -A INPUT -p udp --dport 19132 -j SNAT --to-source 2001:db8::1-2001:db8::6464 -ip6tables -A INPUT -p tcp --syn --dport 25565 -m connlimit --connlimit-above 5 --connlimit-mask 64 -j REJECT --reject-with tcp-reset +ip6tables -A INPUT -p tcp --syn --dport 17891 -m connlimit --connlimit-above 5 --connlimit-mask 64 -j REJECT --reject-with tcp-reset ip6tables-save > /etc/iptables/rules.v6 diff --git a/script/alivecheck.sh b/script/alivecheck.sh index 253a284..9832934 100755 --- a/script/alivecheck.sh +++ b/script/alivecheck.sh @@ -10,7 +10,7 @@ while true; do # If the server doesn't respond to ping, kill it - if [ "$(env printf '\xFE' | nc -w 15 0.0.0.0 25565 | wc -m)" -eq 0 ]; then + if [ "$(env printf '\xFE' | nc -w 15 0.0.0.0 17891 | wc -m)" -eq 0 ]; then pkill -9 java echo $(date) >> ~/kill.log else