add firewall rules with a rules handler, setup command fix and rust server
This commit is contained in:
parent
fb7b388c8e
commit
01e4c835b2
5 changed files with 153 additions and 23 deletions
24
utils/rulelist.rules
Normal file
24
utils/rulelist.rules
Normal file
|
@ -0,0 +1,24 @@
|
|||
# HTTP(s)
|
||||
INPUT -p tcp --dport 80 -j ACCEPT
|
||||
INPUT -p tcp --dport 443 -j ACCEPT
|
||||
|
||||
# SSH
|
||||
INPUT -p tcp --dport 8240 -j ACCEPT
|
||||
|
||||
# WIREGUARD
|
||||
INPUT -p udp --dport 51820 -j ACCEPT
|
||||
|
||||
# MINECRAFT (25565 && 280**)
|
||||
INPUT -p tcp --dport 25565 -j ACCEPT
|
||||
|
||||
# RUST (281**)
|
||||
INPUT -p tcp --dport 28115 -j ACCEPT
|
||||
INPUT -p udp --dport 28115 -j ACCEPT
|
||||
INPUT -p tcp --dport 28116 -j ACCEPT
|
||||
INPUT -p udp --dport 28116 -j ACCEPT
|
||||
INPUT -p tcp --dport 28182 -j ACCEPT
|
||||
INPUT -p udp --dport 28182 -j ACCEPT
|
||||
|
||||
# ALLOW ALL TRAFFIC FROM xxx.xxx.xxx.xxx
|
||||
INPUT -s 87.210.9.220 -j ACCEPT
|
||||
|
42
utils/setup-ports.sh
Executable file
42
utils/setup-ports.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
|
||||
run() {
|
||||
echo "$@"
|
||||
"$@"
|
||||
}
|
||||
|
||||
up() {
|
||||
while read -r line; do
|
||||
[ -z "$line" ] && continue
|
||||
if [ "$(echo "$line" | cut -c1)" = "#" ]; then
|
||||
echo "$line"
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
run iptables -A $line
|
||||
fi
|
||||
done < "$1"
|
||||
}
|
||||
|
||||
down() {
|
||||
while read -r line; do
|
||||
[ -z "$line" ] && continue
|
||||
if [ "$(echo "$line" | cut -c1)" = "#" ]; then
|
||||
echo "$line"
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
run iptables -D $line
|
||||
fi
|
||||
done < "$1"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
up)
|
||||
up "$2"
|
||||
;;
|
||||
down)
|
||||
down "$2"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {up|down}"
|
||||
exit 1
|
||||
esac
|
0
utils/setup.sh
Normal file → Executable file
0
utils/setup.sh
Normal file → Executable file
Reference in a new issue