mr_marcinho
(usa Ubuntu)
Enviado em 15/10/2010 - 16:53h
meu proxy é autenticado ...
segue meu firewall
#/bin/bash
# Carregando Modulos
modprobe ip_tables
modprobe iptable_nat
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
iptables -F
iptables -t nat -F
iptables -A FORWARD -i eth0 -p tcp -m limit --limit 3/minute --limit-burst 3 -j LOG --log-prefix "OUT NEGADO:"
iptables -A FORWARD -i eth1 -p tcp -m limit --limit 3/minute --limit-burst 3 -j LOG --log-prefix "IN NEGADO:"
iptables -A INPUT -i eth0 -p tcp -s 189.14.98.94 -j ACCEPT
iptables -A PREROUTING -i eth0 -t nat -p tcp -s 189.14.98.94 -j DNAT --to 192.168.10.100
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# Destinos que nao passa pelo Proxy
iptables -t nat -I PREROUTING -d 200.180.72.107 -j RETURN
iptables -t nat -I PREROUTING -d 200.247.221.35 -j RETURN
# Computadores Sem Proxy
#iptables -t nat -A PREROUTING -i eth1 -s 192.168.10.190/32 -p tcp -m multiport --dport 80,443,21 -j ACCEPT
#iptables -t nat -A PREROUTING -s eth1 -s 192.168.10.173/32 -p tcp -m multiport --dport 80,443,21 -j ACCEPT
# Ativando Passagem Pelo Proxy
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to 3128
echo 1 > /proc/sys/net/ipv4/ip_forward
# Libera FTP Passivo
iptables -A OUTPUT -p tcp --dport 21 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --sport 21 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --sport 20 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 20 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 1024: --dport 1024: -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 1024: --dport 1024: -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --destination-port 2222 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 80 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 211 -j ACCEPT
# Redirecionamentos
# WTS
iptables -A INPUT -p tcp --destination-port 3389 -j ACCEPT
iptables -A INPUT -p udp --destination-port 3389 -j ACCEPT
iptables -A PREROUTING -t nat -p tcp --dport 3390 -j DNAT --to 192.168.10.100:3389
iptables -A PREROUTING -t nat -p udp --dport 3390 -j DNAT --to 192.168.10.100:3389
# Exitho
iptables -A INPUT -p tcp --destination-port 211 -j ACCEPT
iptables -A INPUT -p udp --destination-port 211 -j ACCEPT
iptables -A PREROUTING -t nat -p tcp --dport 211 -j DNAT --to 192.168.10.100:211
iptables -A PREROUTING -t nat -p udp --dport 211 -j DNAT --to 192.168.10.100:211
iptables -A INPUT -i eth0 -p tcp --destination-port 213 -j ACCEPT
iptables -A INPUT -i eth0 -p udp --destination-port 213 -j ACCEPT
iptables -A PREROUTING -i eth0 -t nat -p tcp --dport 213 -j DNAT --to 192.168.10.100:213
iptables -A PREROUTING -i eth0 -t nat -p udp --dport 213 -j DNAT --to 192.168.10.100:213
iptables -A INPUT -p tcp --syn -s 192.168.10.0/255.255.255.0 -j ACCEPT
iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD -p tcp -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD --protocol tcp --tcp-flags ALL SYN,ACK -j DROP
iptables -A INPUT -p tcp --syn -j DROP