2

I have a working squid caching server which is accessile through 127.0.0.1:3128. I'm trying to route all my trafic(and if possible all my virtual machines) to 127.0.0.1:3128.

I'm using vagrant and virtual box and it would be nice if I don't config each virtualbox to use squid(I'm trying to cache packages to save time and bandwidth).

Thanks

eneepo
  • 219
  • 2
  • 3
  • 8

3 Answers3

5

After many frustrating attemps I could solve my problem with adding following rule:

iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner proxy --dport 80 -j REDIRECT --to-port 3128

and by updating squid.conf:

from http_port 3128 to http_port 3128 accel vhost allow-direct

eneepo
  • 219
  • 2
  • 3
  • 8
2

Take a look at this article. However, you shouldn't forward all traffic to squid. You should forward only http and ftp traffic to squid. Just because all traffic isn't proxyable by default.

You should also use the port in forwarding rules which is configured in squid to access such forwarded traffic - as explained here.

You probably should avoid forwarding https traffic to squid, regardless of the ssl_bump feature configured.

drookie
  • 8,625
  • 1
  • 19
  • 29
0

To transparently route and fitler all HTTP/HTTPS traffic on Linux CentOS 7 set as default gateway in your network (so called intercept style routing) please see this howto - http://docs.diladele.com/tutorials/transparently_filtering_https_centos/index.html

Rafael
  • 534
  • 2
  • 3