sill
(usa Debian)
Enviado em 27/02/2009 - 15:45h
Elgio, vou postar parte da configuração do iptables que fiz como o colega rrafael havia me sugerido.
#!/bin/bash
# REGRAS DE FIREWALL PROXY ;SQUID ;APACHE ;SARG ;DHCP3-SERVER ;BIND
#########################################################################
#
echo
echo "=========================================="
echo "| :: SETTING IPTABLES'S CONFIGURATION :: |"
echo "=========================================="
#
EXTERNAL=eth0
INTERNAL=eth1
IP=10.10.1.0/28
#
flush_rules()
{
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -Z
}
#
add_rules()
{
######################Habilitando o roteamento
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "Roteamento .........................[ OK ]"
#
#
######################CARREGANDO MODULOS
/sbin/modprobe ip_tables
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_mangle
/sbin/modprobe iptable_nat
/sbin/modprobe ipt_MASQUERADE
/sbin/modprobe ipt_state
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ipt_multiport
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ipt_tos
/sbin/modprobe ipt_limit
echo "Loading iptables's modules .........[ OK ]"
#
######################Liberacao do Loopback
iptables -A INPUT -i lo -j ACCEPT
#
######################Ativa mascaramento de saida
iptables -A POSTROUTING -t nat -o $EXTERNAL -j MASQUERADE
#
######################REDIRECIONANDO PROXY TRANSPARENTE
iptables -t nat -A PREROUTING -i $INTERNAL -p tcp --dport 80 -j REDIRECT --to-port 3128
#
####################DNS
iptables -I POSTROUTING -j MASQUERADE -t nat -s $IP -p udp --dport 53 -o $EXTERNAL
#
Adaptando à sua sugestão em DNS, minha configuração então ficará:
iptables -t nat -A POSTROUTING -o $EXTERNAL -s $INTERNAL -p udp --dport 53 -j MASQUERADE
correto? outra coisa, lá no inicio do iptables onde tem a seguinte informação:
EXTERNAL=eth0
INTERNAL=eth1
IP=10.10.1.0/28 >>>>> deixo este ip ou coloco o ip válido (speedy) ou falso (interno)??