Squid traffic tunneled through VPN

squidtunnelingvpn

So what I'm trying to do is have a Squid Proxy run on 1 machine along side a VPN connection. What I want to happen is all traffic running though the Squad Proxy would run though the VPN for its outbound. ie Desktop -> (Squid Proxy -> VPN)

The goal is to allow my desktop selective tunneling through the VPN. So that Instant Messaging and the like that do not need to run through the VPN can go through my normal traffic. Typically I would go though a SSH Proxy but currently am forced to use VPN to gain entry into the office, and a Squid proxy seemed like it might work out the easiest for what I am needing.

EDIT> Realize I forgot to actually state what problem I'm running into. I have the Squid setup and verified it works, but once I connect to the VPN. All requests to Squid get accepted but Squid is unable to make the request over the VPN. So the client ends up just sitting there.

Best Answer

I do something similar. I do it using two pieces:

$ cat bin/openproxy
#!/bin/bash
ssh -C -o ServerAliveInterval=150 -L 3128:proxy:3128 gateway.company.com

Then in Firefox, I use FoxyProxy to use localhost:3128 as a proxy for machines in *.company.com.

This works for pretty much everything that I need.

Is this what you're trying to do?