I am struggling in configuring transparent squid proxy.
I have installed Ubuntu 20.04 and squid.
If I write into browser my proxy parameters, I can access Internet, that is ok.

But I want to configure transparent proxy.

Iptables status is not active.
UFW is active.
I allowed in ufw 22/tcp, 3128/tcp, 53/udp, 80/tcp, 8080/tcp ports.

My squid conf (2 main lines):

http_port 3128
http_port 8080 intercept

My ufw rule in /etc/ufw/before.rules:

-A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 3128

In my PC, i set proxy server's IP address as the gateway and DNS.
But I am having problems, it still does not work.
Access.log is empty.

Any help and advice would be appreciated. Thanks.

1 Answer 1


In your Squid configuration, you have the port for the interception proxy set for port 8080, and your ufw before rule is written so that client connections going to port 8080 going to port 3128. Try setting your ufw dport parameter to 80 and to-port to 8080 (as you have configured in your Squid configuration). That should take care port HTTP, so you'd also need to set up your configuration to work with HTTPS, if you're looking to do forward that as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .