Сначала настройка iptables:
apt-get install iptables-persistent
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
:BAN - [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -m state --state INVALID -j DROP
-A INPUT -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP
-A INPUT -p tcp --dport 22 -s IP_для_администрирования -j ACCEPT
-A INPUT -p udp --dport 9987 -m connlimit --connlimit-above 3 --connlimit-mask 32 -j DROP
-A INPUT -p udp --dport 9987 -m connlimit --connlimit-above 50 --connlimit-mask 0 -j DROP
-A INPUT -p tcp --dport 30033 -m connlimit --connlimit-above 1 --connlimit-mask 32 -j DROP
-A INPUT -p tcp --dport 30033 -m connlimit --connlimit-above 2 --connlimit-mask 0 -j DROP
-A INPUT -p udp -m udp --dport 9987 -m recent --rcheck --name baned -j DROP
-A INPUT -p udp -m udp --dport 9987 -m recent --rcheck --name grayed --seconds 600 --hitcount 20 -j BAN
-A INPUT -p udp -m udp --dport 9987 -m recent --rcheck --name grayed --seconds 300 --hitcount 10 -j DROP
-A INPUT -p udp -m udp --dport 9987 -m recent --set --name grayed -j ACCEPT
-A INPUT -p tcp -m tcp --dport 30033 -m recent --rcheck --name baned -j DROP
-A INPUT -p tcp -m tcp --dport 30033 -m recent --rcheck --name grayed --seconds 600 --hitcount 20 -j BAN
-A INPUT -p tcp -m tcp --dport 30033 -m recent --rcheck --name grayed --seconds 300 --hitcount 10 -j DROP
-A INPUT -p tcp -m tcp --dport 30033 -m recent --set --name grayed -j ACCEPT
-A BAN -m recent --set --name baned -j DROP
COMMIT
Порт для передачи запросов на сервер (TCP): 10011
License port (TCP): 2008
Weblist port (UDP): 2010
DNS port (TCP): 41144
Применяем правила:
iptables-restore < /etc/iptables/rules.v4
iptables -L -v
Teamspeak
adduser ts3server
cd /home/ts3server/
wget http://dl.4players.de/ts/releases/3.0.13.6/teamspeak3-server_linux_amd64-3.0.13.6.tar.bz2
tar xvjf *.tar.bz2
cd teamspeak3-server_linux_amd64
chmod +x ts3server_minimal_runscript.sh
chmod +x ts3server_startscript.sh
chmod +x ts3server
./ts3server_minimal_runscript.sh
------------------------------------------------------------------
I M P O R T A N T
------------------------------------------------------------------
Server Query Admin Account created
loginname= "serveradmin", password= "*********"
------------------------------------------------------------------
ServerAdmin privilege key created, please use it to gain
serveradmin rights for your virtualserver. please
also check the doc/privilegekey_guide.txt for details.
token=*****************************************
------------------------------------------------------------------
cd /home
chown -R ts3server:ts3server ts3server
EDITOR="nano"
export EDITOR
crontab -u ts3server -e
@reboot ts3server /home/ts3server/teamspeak3-server_linux_amd64/ts3server_startscript.sh start