jjmaes10
(usa Debian)
Enviado em 01/06/2016 - 22:50h
Eai Galera... Estou com um problema no meu squid3.. na configuração abaixo ele bloqueia tudo, mais consigo efetuar o ping tanto para rede quanto para internet, mais não acessa nenhum site... quem puder me ajudar a encontrar o erro.. agradeço
#### script Firewall ###=====================================================================================
#!/bin/bash
# Interface Internet
wan="eth0"
# Interface Local
lan="eth1"
iniciar(){
### Ativando os modulos ###
modprobe ip_nat_ftp
modprobe iptable_filter
modprobe iptable_nat
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ipt_LOG
modprobe ipt_state
modprobe ipt_REJECT
modprobe ipt_MASQUERADE
modprobe ip_gre
modprobe iptable_nat
### Compartilhando a Conexão ###
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o $wan -j MASQUERADE
### Regras Básicas ###
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i $lan -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --syn -j DROP
### Ativando Proxy transparente ####
iptables -t nat -A PREROUTING -i $lan -p tcp --dport 80 -j REDIRECT --to-port 3128
echo "Proxy Transparent ativado...........................................[ok]"
}
parar(){
iptables -F
iptables -F -t nat
}
case "$1" in
"start") iniciar ;;
"stop") parar ;;
"restart") parar ; iniciar ;;
*) echo "Use os parametros start ou stop"
esac
=====================================================================================================
Squid.conf
### Squid by leonardo
http_port 3128
#http_port 3128 transparent
#http_port 3128 intercept
visible_hostname Debian_Squid
### ===== DEFININDO OS PARAMETROS ===== ###
cache_mem 64 MB
maximum_object_size_in memory 64 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 16 256
caches_access_log /var/log/squid/access.log
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
### ===== REGRAS BÁSICAS ================ ###
#acl manager proto cache_object
#acl localhost src 127.0.0.1/255.255.255.0
acl SSL_ports port 443 563
acl Safe_ports port 21 80 443 563 70 210 280 488 59 777 901 1025-65535
acl purge method PURGE
acl CONNECT method CONNECT
### ===== APLICANDO AS REGRAS BÁSICAS === ###
#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
### ===== APLICANDO AS REGRAS ============ ###
acl redelocal src 10.0.0.0/24
acl bloqueados url_regex -i "/etc/squid3/bloqueados"
acl permitidos url_regex -i "/etc/squid3/permitidos"
http_access allow localhost
http_access allow redelocal
http_access deny all !permitidos
===========================================================================================================
Desculpem qualquer erro de iniciante.
e obrigado