hugo.andrade
(usa Red Hat)
Enviado em 04/10/2011 - 11:41h
Bom dia,
Tenho um firewall montado aqui com Balanceamento de carga com dosi links.
Está funcionando belezinha o balanceamento só que o redirecionamento não cunciona e preciso dele pra acessar meu servidor win2003 pelo Terminal server.
O tutorial que usei pra fazer o balanceamento foi este aqui:
http://www.jundlinux.com.br/balanceamento_de_carga
Deem uma olhada no meu script de firewall pra ver se tem alguma coisa errada com ele
#!/bin/bash
interna="eth0"
link1="eth1"
link2="eth2"
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -F POSTROUTING -t nat
iptables -F PREROUTING -t nat
iptables -F -t nat
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
/sbin/modprobe iptable_nat
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ipt_LOG
/sbin/modprobe ipt_REJECT
/sbin/modprobe ipt_MASQUERADE
/sbin/modprobe ip_conntrack_pptp
/sbin/modprobe ipt_layer7
/sbin/modprobe ipt_mark
/sbin/modprobe ipt_MARK
#Layer7
iptables -A FORWARD -m layer7 --l7proto msnmessenger -j DROP
iptables -A FORWARD -m layer7 --l7proto msn-filetransfer -j DROP
#Conectividade Social
iptables -t nat -A PREROUTING -s 131.195.2.21 -d 0.0.0.0/0 -j ACCEPT #CONTABIL4
iptables -t nat -A PREROUTING -s 131.195.2.24 -d 0.0.0.0/0 -j ACCEPT #PESSOAL1
iptables -t nat -A PREROUTING -i eth0 -p tcp -d ! 200.201.174.0/24 --dport 80 -j REDIRECT --to-port 3128
iptables -A FORWARD -i $interna -p tcp --dport 3128 -j ACCEPT
iptables -A FORWARD -i $interna -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i $interna -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -A FORWARD -i $interna -p tcp --dport 53 -j ACCEPT
iptables -A FORWARD -i $interna -p udp --dport 53 -j ACCEPT
iptables -A FORWARD -i $interna -p tcp --dport 110 -j ACCEPT
iptables -A FORWARD -i $interna -p udp --dport 110 -j ACCEPT
iptables -A FORWARD -i $interna -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -p udp --dport 443 -j ACCEPT
iptables -A FORWARD -i $interna -p tcp --dport 443 -j ACCEPT
iptables -A FORWARD -p tcp --dport 20 -j ACCEPT
iptables -A FORWARD -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A FORWARD -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i $link1 -m state --state ! ESTABLISHED,RELATED -j DROP
iptables -A INPUT -i $link2 -m state --state ! ESTABLISHED,RELATED -j DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT
iptables -t nat -A POSTROUTING -o $link1 -j MASQUERADE
iptables -t nat -A POSTROUTING -o $link2 -j MASQUERADE
iptables -A FORWARD -i $link1 -j ACCEPT
iptables -A FORWARD -o $link1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $link2 -j ACCEPT
iptables -A FORWARD -o $link2 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT
iptables -A FORWARD -o $link1 -i $interna -j ACCEPT
iptables -A FORWARD -o $link2 -i $interna -j ACCEPT
Desde já agradeço a quem possa me ajudar.
Att,
Hugo Alexandre