I have a home network with 4-5 clients, and a server. The server runs Squid 2.7. The clients are all configured to use squid as a proxy server. I would like to be able to establish an SSH tunnel with dynamic port forwarding (basically set up a SOCKS proxy), and make all of squid's traffic be tunneled through the SSH connection (or SOCKS proxy) to the remote machine.

I don't think there is an option within squid's config files to do this, so I think that I might have to use iptables - but I am unsure of how to construct such a rule.

If this is not possible, then I might be able to install squid on the remote server, and then use cache_peer. However, I would like to avoid that if at all possible. The fewer the services the better (in my book) - and performance isn't my HIGHEST priority here. I would also like to avoid upgrading to Squid 3.0 at this point... although if it is the best option, I will consider it.

  • What is "the remote machine" you are talking about? – Massimo Jun 8 '11 at 19:18
  • It's the machine running sshd which my proxy server would connect to, and tunnel traffic through. – Joseph Redfern Jun 8 '11 at 19:19
  • Ok, but what kind of traffic? Traffic directed to that machine? Traffic meant for other machines behind it? Generic Internet traffic? – Massimo Jun 8 '11 at 19:24
  • Traffic meant for both the machines behind the proxy, and for the machine it's self. Although the machines behind the proxy are the most important. – Joseph Redfern Jun 8 '11 at 19:28
  • So basically you want a VPN... – Massimo Jun 8 '11 at 20:07

I ended up using OpenVPN. I've got another question about that.... but if I end up asking it, I will post separately.

  • Please mark this as the answer. – pauska Jun 9 '11 at 15:06
  • Thanks for reminding me. It wouldn't let me do it to begin with (1 day self answer rule) – Joseph Redfern Jun 11 '11 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.