iptables -P INPUT ACCEPT
iptables -F
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT # SSH
iptables -A INPUT -p tcp --dport 80 -j ACCEPT # HTTP
iptables -A INPUT -p tcp --dport 443 -j ACCEPT # HTTPS
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT # MySQL
iptables -A INPUT -p tcp --dport 8888 -j ACCEPT # Proxy
iptables -A INPUT -p tcp --dport 9091 -j ACCEPT # Transmission remote
iptables -A INPUT -p tcp --dport 51413 -j ACCEPT # Transmission data
iptables -A INPUT -p udp --dport 51413 -j ACCEPT # Transmission data
iptables -A INPUT -p tcp --dport 8192 -j ACCEPT # Minecraft votifier
iptables -A INPUT -p tcp --dport 25565 -j ACCEPT # Minecraft server
iptables -A INPUT -p tcp --dport 25535 -j ACCEPT # Muezli test server
iptables -A INPUT -p tcp --dport 25525 -j ACCEPT # Muezli tekkit server
iptables -A INPUT -p tcp --dport 25585 -j ACCEPT # Minecraft query
iptables -A INPUT -p tcp --dport 25567 -j ACCEPT # Minecraft livemap
iptables -A INPUT -m udp -p udp --dport 27000:27015 -j ACCEPT # TF2 server
iptables -A INPUT -m tcp -p tcp --dport 27000:27015 -j ACCEPT # TF2 server
iptables -A INPUT -p udp -m udp --dport 137 -j ACCEPT # SMB
iptables -A INPUT -p udp -m udp --dport 138 -j ACCEPT # SMB
iptables -A INPUT -p tcp -m tcp --dport 139 -j ACCEPT # SMB
iptables -A INPUT -p tcp -m tcp --dport 445 -j ACCEPT # SMB
iptables -A INPUT -j DROP
service iptables save
service iptables restart
iptables -L -v