I have set up squid (v.3.2.6) to block distractions like Facebook, GMail, YouTube on a specific machine, which runs Arch Linux. This works fine, if I set the proxy settings for the browser to squid (localhost:3128).
Now I want to redirect all traffic to the squid proxy. This should be possible with iptables (v.1.4.16) NAT table, but the sample solutions I have found don’t work for me. This does nothing:
-A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128
I also set the squid port to:
http_port 3128 intercept
If I change the PREROUTING to OUTPUT the whole traffic seems to go over squid, but I get the error “The requested URL could not be retrieved”.
Just to clarify squid and iptables are on the same machine. Any suggestions?