acolatto
(usa Debian)
Enviado em 30/03/2012 - 15:13h
fala ai galera....
ja li varios e varios artigos sobre o assunto e todos apontam para o mesmo lugar, o qual aparentemente estou fazendo, porem, nao funciona.... alguem poderia me ajudar?
eu consigo pingar tudo certo porem nao acessa a internet dos terminais, de modo algum e no firewall consigo acessar até demais, ou seja, no firewall se eu nao colocar o proxy ele acessa direto sem controle pelo squid.
segue abaixo configuração simples do IPTABLES e SQUID.
IPTABLES:
#!/bin/bash
#########################
echo "declarando variaveis....... ok"
#########################
#programas diversos
PATH=/sbin:/bin:/usr/sbin:/usr/bin
#caminho estrututa do iptables
IPTABLES=/sbin/iptables
#caminho do script
PROGRAMA=/etc/init.d/regras.fw
#INTERFACES E IPS
IP_WAN=192.168.6.190
IP_ADM=10.1.1.1
IP_ALUNOS=128.1.1.1
GW=192.168.6.254
WAN=eth0
ADM=eth1
ALUNOS=eth2
#Definindo saidas padroes
route add default $WAN
route add default gw $GW
#modulos do iptables do MODPROBE
modprobe iptable_filter
modprobe iptable_nat
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
modprobe ipt_LOG
modprobe ipt_REJECT
modprobe ipt_state
modprobe ipt_multiport
modprobe iptable_mangle
modprobe ipt_tos
modprobe ipt_limit
modprobe ipt_mark
modprobe ipt_MARK
echo "Ativando Roteamento... ok"
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "Limpando Regras Existentes... ok"
$IPTABLES -F -t filter
$IPTABLES -F -t nat
$IPTABLES -F -t mangle
$IPTABLES -X -t filter
$IPTABLES -X -t nat
$IPTABLES -X -t mangle
$IPTABLES -Z -t filter
$IPTABLES -Z -t nat
$IPTABLES -Z -t mangle
echo "Definindo politica padrao DROP... ok"
$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P FORWARD DROP
echo "Ativando fluxo interno entre processos... ok"
$IPTABLES -I INPUT -i lo -j ACCEPT
$IPTABLES -I OUTPUT -o lo -j ACCEPT
$IPTABLES -I INPUT -m state --state ESTABLISHED -j ACCEPT
$IPTABLES -I INPUT -m state --state RELATED -j ACCEPT
$IPTABLES -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -I OUTPUT -p icmp -j ACCEPT
$IPTABLES -I INPUT -p icmp -j ACCEPT
echo "Ativando mascaramento... ok"
$IPTABLES -t nat -A POSTROUTING -o $WAN -s 0/0 -j MASQUERADE
echo "Ativando comunicação entre redes... ok"
$IPTABLES -I FORWARD -i $ADM -o $ALUNOS -p icmp -j ACCEPT
$IPTABLES -I FORWARD -i $ADM -o $ALUNOS -p tcp -j ACCEPT
$IPTABLES -I FORWARD -i $ADM -o $WAN -p tcp -j ACCEPT
$IPTABLES -I FORWARD -i $ALUNOS -o $WAN -p tcp -j ACCEPT
$IPTABLES -I FORWARD -i $ADM -o $WAN -p icmp -j ACCEPT
$IPTABLES -I FORWARD -i $ALUNOS -o $WAN -p icmp -j ACCEPT
echo "Ativando proxy transparent... OK"
$IPTABLES -t nat -A PREROUTING -s 0/0 -p tcp --dport 80 -j REDIRECT --to-port 3128
__________________________________
SQUID:
################################################
# Definindo porta padrao do SQUID PROXY
################################################
http_port 3128 transparent
################################################
# Definindo nome do FIREWALL
################################################
visible_hostname firewall-ALC
#################################################
# Optimizacao FW - CACHE
#################################################
cache_mem 200 MB
maximum_object_size_in_memory 100 KB
maximum_object_size 512 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid 2048 32 512
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
cache_access_log /var/log/squid/access.log
#################################################
# Definindo ACLs
#################################################
acl all src 0/0
acl localhost src 127.0.0.1/32
acl adm src 10.1.1.0/24
acl alunos src 128.0.0.0/16
acl manager proto cache_object
acl liberados url_regex -i "/etc/squid/list/sites-liberados"
acl bloqueados url_regex -i "/etc/squid/list/sites-bloqueados"
acl restritos dstdom_regex "/etc/squid/list/palavras-bloqueadas"
acl SSL_ports port 443 563 #HTTP, SNEWS
acl Safe_ports port 6901
acl Safe_ports port 6981
acl Safe_ports port 80 #HTTP
acl Safe_ports port 70 #GOPHER
acl Safe_ports port 210 #WAITS
acl Safe_ports port 280 #HTTP,NGMT
acl Safe_ports port 1025-29000 #PORTAS NAO DECLARADAS
acl Safe_ports port 29002-65535 #PORTAS NAO DECLARADAS
acl Safe_ports port 488 #GSS, HTTP
acl Safe_ports port 591 #FILEMAKER
acl Safe_ports port 777 #MULTILING PORT
acl purge method PURGE
acl CONNECT method CONNECT
#############################################
# Aplicando regras
#############################################
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow liberados
http_access deny bloqueados
http_access deny restritos
http_access allow adm
http_access allow alunos
http_access allow localhost
http_access deny all
ALGUEM PODE ME AJUDAR!!
VLW!