arkanjoking
(usa Debian)
Enviado em 14/01/2008 - 06:44h
Agora Mudei minha configuração de iptables para esta, e mesmo assim, os jogos nao funcionam, micro navega normal porém os jogos online nao acessam!
#!/bin/bash
#Configuracoes do Firewall
#/etc/init.d/rc.firewall------------------------------------------------------------
#Configuracao das Interfaces--------------------------------------------------------
Externa=eth1
RedeRanger=192.168.0.0/30
Interna=eth0
#-----------------------------------------------------------------------------------
#Limpando Todas as Regras-----------------------------------------------------------
#-----------------------------------------------------------------------------------
iptables -F
iptables -X
iptables -F -t nat
iptables -X -t nat
iptables -F -t mangle
iptables -X -t mangle
iptables -F -t filter
#-----------------------------------------------------------------------------------
#Zera Contadores das cadeias--------------------------------------------------------
iptables -Z -t nat
iptables -Z -t mangle
iptables -Z -t filter
#Ativando Modulos-------------------------------------------------------------------
#-----------------------------------------------------------------------------------
modprobe iptable_nat
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ipt_MASQUERADE
modprobe ipt_LOG
modprobe ipt_REJECT
modprobe ip_nat_ftp
#-----------------------------------------------------------------------------------
#Ativando IP FORWARD, redirecionamento----------------------------------------------
echo "1" > /proc/sys/net/ipv4/ip_forward
#-----------------------------------------------------------------------------------
#Anti Spoofing----------------------------------------------------------------------
for spoofing in /proc/sys/net/ipv4/conf/*/rp_filter; do
echo "0" > $spoofing
done
#-----------------------------------------------------------------------------------
#Anti-Redirects---------------------------------------------------------------------
echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
#-----------------------------------------------------------------------------------
#Anti Source Route------------------------------------------------------------------
echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
#-----------------------------------------------------------------------------------
#Anti Bugus Response----------------------------------------------------------------
echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
#-----------------------------------------------------------------------------------
#Anti Synflood Protection-----------------------------------------------------------
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
#-----------------------------------------------------------------------------------
#Ping Ignore------------------------------------------------------------------------
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
#-----------------------------------------------------------------------------------
#Protecao Contra Trino--------------------------------------------------------------
iptables -N TRINOO
iptables -A TRINOO -m limit --limit 15/m -j LOG --log-level 6 --log-prefix "FIREWALL: trinoo: "
iptables -A TRINOO -j DROP
iptables -A INPUT -p tcp -i $Externa --dport 27444 -j TRINOO
iptables -A INPUT -p tcp -i $Externa --dport 27665 -j TRINOO
iptables -A INPUT -p tcp -i $Externa --dport 31335 -j TRINOO
iptables -A INPUT -p tcp -i $Externa --dport 34555 -j TRINOO
iptables -A INPUT -p tcp -i $Externa --dport 35555 -j TRINOO
#-----------------------------------------------------------------------------------
#Protecao Contra Trojans------------------------------------------------------------
iptables -N TROJAN
iptables -A TROJAN -m limit --limit 15/m -j LOG --log-level 6 --log-prefix "FIREWALL: trojan: "
iptables -A TROJAN -j DROP
iptables -A INPUT -p tcp -i $Externa --dport 666 -j TROJAN
iptables -A INPUT -p tcp -i $Externa --dport 4000 -j TROJAN
iptables -A INPUT -p tcp -i $Externa --dport 6000 -j TROJAN
iptables -A INPUT -p tcp -i $Externa --dport 6006 -j TROJAN
iptables -A INPUT -p tcp -i $Externa --dport 16660 -j TROJAN
#------------------------------------------------------------------------------------
#Protecao Contra Worms---------------------------------------------------------------
iptables -A FORWARD -p tcp --dport 135 -i $Externa -j REJECT
#------------------------------------------------------------------------------------
#Protecao Contra syn-flood
#------------------------------------------------------------------------------------
iptables -A FORWARD -p tcp --syn -m limit --limit 2/s -j ACCEPT
#------------------------------------------------------------------------------------
#Protecao Contra Ping da morte
#------------------------------------------------------------------------------------
iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
#------------------------------------------------------------------------------------
#Protecao Contra port scanners
#------------------------------------------------------------------------------------
iptables -N SCANNER
iptables -A SCANNER -m limit --limit 15/m -j LOG --log-level 6 --log-prefix "FIREWALL: port scanner: "
iptables -A SCANNER -j DROP
iptables -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH -i $Externa -j SCANNER
iptables -A INPUT -p tcp --tcp-flags ALL NONE -i $Externa -j SCANNER
iptables -A INPUT -p tcp --tcp-flags ALL ALL -i $Externa -j SCANNER
iptables -A INPUT -p tcp --tcp-flags ALL FIN,SYN -i $Externa -j SCANNER
iptables -A INPUT -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -i $Externa -j SCANNER
iptables -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -i $Externa -j SCANNER
iptables -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -i $Externa -j SCANNER
#-------------------------------------------------------------------------------------
#Regras PREROUTING-Redicionamento de Portas-------------------------------------------
iptables -t nat -A PREROUTING -s $RedeRanger -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -s $RedeRanger -p tcp --dport 8080 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -i $Externa -p tcp --dport 5900 -j DNAT --to 192.168.0.200
#-------------------------------------------------------------------------------------
#Regras INPUT-------------------------------------------------------------------------
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 0 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp --dport 1194 -j ACCEPT
iptables -A INPUT -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -p tcp --dport 3128 -j ACCEPT
#--------------------------------------------------------------------------------------
#Regras FORWARD------------------------------------------------------------------------
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p icmp -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 25 -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 22 -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 110 -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 443 -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 3389 -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 15779 -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 1042 -j ACCEPT
iptables -A FORWARD -i $Interna -o $Externa -p tcp --dport 44405 -j ACCEPT
iptables -A FORWARD -i $Externa -o $Interna -p tcp --dport 5900 -j ACCEPT
#----------------------------------------------------------------------------------------
#Regras OUTPUT---------------------------------------------------------------------------
iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
#----------------------------------------------------------------------------------------
#Regras POSTROUTING, Mascamento Saida----------------------------------------------------
iptables -t nat -A POSTROUTING -o $Externa -j MASQUERADE
#----------------------------------------------------------------------------------------
echo "========================================================"
echo " --------> Firewall Ativo <---------- "
echo "========================================================"