[squid-users] transparent squid not working

Alex Gutiérrez Martínez alex at dvm.esines.cu
Mon Sep 24 14:36:46 UTC 2018

Hi community, im tyin to configure a squid transparent proxy, i obtain 
internet thanks to a parent proxy. I have 3 Ip declare on my iptables 
config file is the administration ip, is my 
parent proxy ip and is the lan segment where my client 
are. This is my config:


acl http port 80
http_access allow http
acl https port 443
http_access allow https
never_direct allow all
cache_peer parent 804
http_port 3128 transparent
cache_mem 64 MB
cache_dir aufs /var/cache/squid 1024 16 256
acl mired src
acl localhost src
http_access allow mired
http_access allow localhost
http_access deny all
acl deny_ipaccess url_regex [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
http_access deny deny_ipaccess

#iptables config

echo n Aplicando Reglas de Firewall...
## FLUSH de reglas
iptables -F
iptables -X
iptables -Z
iptables -t nat -F
## Establecemos politica por defecto
iptables -P INPUT DROP
## Empezamos a filtrar
# El localhost se deja (por ejemplo conexiones locales a mysql)
/sbin/iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -s -j ACCEPT
iptables -A INPUT -s -j ACCEPT
iptables -A INPUT -s -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -s --dport 80 -j 
REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -p tcp -s --dport 443 -j 
REDIRECT --to-port 3128
iptables -t nat -A POSTROUTING -s -d -o 
enp0s3 -j MASQUERADE
#iptables save
iptables-save > /etc/iptables/rules.v4
echo " OK . Verifique que lo que se aplica con: iptables -L -n"
# Fin del scrip

Can someone be so nice to explain to me wy this is not working.

Thanks in advance. Remember, always attack ideas, never people.

Saludos Cordiales

Lic. Alex Gutiérrez Martínez

Tel. +53 7 2710327

More information about the squid-users mailing list