jrtil
(usa GoboLinux)
Enviado em 13/02/2012 - 21:15h
Certo.
Sim, meu roteador esta com o cabo na porta WAN.
Lembrando que funciona normail se eu pegar o cabo e colocar em um pc, acesso sem passar pelo proxy
As requisições são essas..:
echo "# Limpando Regras #"
$IPTABLES -F INPUT
$IPTABLES -F OUTPUT
$IPTABLES -F FORWARD
$IPTABLES -t nat -F
echo "#### OK ####"
echo "###Carregando os modulos necessários do IPTABLES###"
#/sbin/modprobe ipt_LOG
#/sbin/modprobe ipt_REJECT
#/sbin/modprobe ipt_MASQUERADE
modprobe iptable_nat
modprobe ip_conntrack_ftp
#/sbin/modprobe ip_conntrack_irc
modprobe ip_nat_ftp
echo "#### OK ####"
echo "# Modulo encaminhador de pacotes #"
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "#### OK ####"
echo "# Libera alguns IPS para não passarem pelo firewall #" 80 -j ACCEPT
echo "#### JR ####"
#$IPTABLES -t nat -A PREROUTING -i eth0 -s 192.168.0.10 -p tcp --dport 80 -j ACCEPT
echo "#### OK ####"
echo "# bloqueia algumas coisinhas de comunicação/batepapo #"
$IPTABLES -A FORWARD -p tcp -d imo.im --dport 443 -j DROP
$IPTABLES -A FORWARD -p tcp -d o.imo.im --dport 443 -j DROP
$IPTABLES -A FORWARD -p tcp -d vtunnel.com --dport 443 -j DROP
$IPTABLES -A FORWARD -p tcp -d meebo.com --dport 443 -j DROP
$IPTABLES -A FORWARD -p tcp -d account.live.com --dport 443 -j DROP
$IPTABLES -A FORWARD -p tcp -d account.live.com.br --dport 443 -j DROP
echo "## BLOQEUANDO O Ultrasurf ##"
$IPTABLES -A FORWARD -p tcp -d 65.49.2.0/24 -j DROP
$IPTABLES -A FORWARD -p tcp -d 65.49.14.0/24 -j DROP
$IPTABLES -A FORWARD -p tcp --dport 19769 -j DROP
echo "#############################"
echo "## BLOQEUANDO Bate papo gmail ##"
$IPTABLES -I INPUT -s chatenabled.mail.google.com -j DROP
$IPTABLES -A OUTPUT -d chatenabled.mail.google.com -j DROP
$IPTABLES -I FORWARD -s 0/0 -d chatenabled.mail.google.com -j DROP
echo "#### OK ####"
echo "# A BENDITA CAIXA - CONECTIVIDADE #"
$IPTABLES -t nat -I PREROUTING -i eth1 -p tcp -d ! 200.201.0.0/16 --dport 80 -j REDIRECT --to-port 8080
$IPTABLES -t nat -I PREROUTING -p tcp -d 200.201.0.0/16 -j ACCEPT
$IPTABLES -I FORWARD -p tcp -d 200.201.0.0/16 -j ACCEPT
echo "#### OK ####"
echo "# Protecao contra spoof de IP #"
echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
echo "#### OK ####"
echo "# DATASUS #"
$IPTABLES -A FORWARD -d 200.214.44.204 -j ACCEPT
$IPTABLES -A FORWARD -d siopftp.datasus.gov.br -j ACCEPT
echo "#### OK ####"
echo "# JOGOS CS E VALVE/UNREAL #"
$IPTABLES -A INPUT -s $LAN_IP_RANGE -p udp --dport 27015 -j DROP
$IPTABLES -A INPUT -s $LAN_IP_RANGE -p udp --dport 2701 -j DROP
echo "#### OK ####"
echo "### Bloqueando os -:P2P:- ###"
echo "-------------------------------"
echo "### Bittorrent ###"
echo "### Imesh ###"
$IPTABLES -A FORWARD -d 216.35.208.0/24 -j REJECT
echo "### BearShare ###"
$IPTABLES -A FORWARD -p TCP --dport 6346 -j REJECT
echo "### Morpheus ###"
$IPTABLES -A FORWARD -d 206.142.53.0/24 -j REJECT
$IPTABLES -A FORWARD -p TCP --dport 1214 -j REJECT
echo "### KaZaA ###"
$IPTABLES -A FORWARD -d 213.248.112.0/24 -j REJECT
$IPTABLES -A FORWARD -p TCP --dport 1214 -j REJECT
echo "### Limewire ###"
$IPTABLES -A FORWARD -p TCP --dport 6346 -j REJECT
echo "### Audiogalaxy ###"
$IPTABLES -A FORWARD -d 64.245.58.0/23 -j REJECT
echo "OK"
echo "# Liberando SSH somente para enderecos confiaveis #"
$IPTABLES -A INPUT -p tcp -s 192.168.0.0/255.255.255.0 --dport 22 -j ACCEPT
echo "### OK ####"
echo "# Pacotes alterados de TCP indesejáveis se ferram aqui #"
$IPTABLES -A FORWARD -p tcp ! --syn -m state --state NEW -j LOG --log-prefix "Novo pacote não syn:"
$IPTABLES -A FORWARD -p tcp ! --syn -m state --state NEW -j DROP
echo "#### OK ####"
echo "# Proteção contra Trino(Ataque) #"
$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 $WAN --dport 27444 -j TRINOO
$IPTABLES -A INPUT -p TCP -i $WAN --dport 27665 -j TRINOO
$IPTABLES -A INPUT -p TCP -i $WAN --dport 31335 -j TRINOO
$IPTABLES -A INPUT -p TCP -i $WAN --dport 34555 -j TRINOO
$IPTABLES -A INPUT -p TCP -i $WAN --dport 35555 -j TRINOO
echo "#### OK ####"
echo "# Proteção contra alguns Worms #"
$IPTABLES -A FORWARD -p tcp --dport 135 -i $WAN -j REJECT
echo "#### OK ####"
echo "# Proteção contra syn-flood #"
$IPTABLES -A FORWARD -p tcp --syn -m limit --limit 2/s -j ACCEPT
echo "#### OK ####"
echo "# Proteção contra ping da morte #"
$IPTABLES -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
echo "#### OK ####"
echo "# Bloqueio NetBus -#"
$IPTABLES -A INPUT -p tcp --dport 12345:12346 -j DROP
$IPTABLES -A INPUT -p udp --dport 12345:12346 -j DROP
echo "#### OK ####"
echo "# Obriga a passagem pelo firewall #"
$IPTABLES -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
echo "#### OK ####"
echo "# Habilita o proxy transparente #"
iptables -A POSTROUTING -t nat -o eth1 -j MASQUERADE
echo "#### OK ####"
echo "# Bloqueio ping IP -#"
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all