Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a personal setup at home using VMWare Workstation. I also have a set of Virtual Private Machines that run Squid, and therefore provide me HTTPS proxy tunnels. Using Proxifier, I can tunnel all traffic for given applications through these tunnels.

However, I also have a few virtual machines for dev/staging/experimentation/etc. I generally just use NAT to provide Internet access to the machines, and if I need to use these proxies, I can just setup Proxifier (or a Linux equivalent) to pipe the traffic through them. No problem.

But... I got to thinking: Wouldn't it be great if I could assign these proxy tunnels to a virtual machine, so that when I start up the VM, it has instant-on access through the tunnel and not my local connection? (EDIT: Of course, it would USE my local connection, but it would tunnel traffic through the proxy.)

To be more clear: I want a solution that binds the proxy to a VM, so that when I start the VM, I don't have to use a proxy client to connect to the tunnel - I am already piping all traffic from that VM through that proxy.

I did a bit of searching, and the closest thing I could find was this:

How to route public static IP to a virtual machine on a vmware ESXi host?

Which wasn't all that applicable.

The proxies are protected by user/pass but do not filter by IP. Again, they are HTTPS proxies setup through Squid.

Any ideas on how to make this happen? Thanks a ton.

share|improve this question

1 Answer 1

From what I understand, you want to :

  • Start a specific VM called 'proxy' (on a VPS, outside your inner network)
  • Start a second VM called 'client' (locally)
  • Have 'client' automatically use SQUID (HTTPS) on 'proxy'.

IF your PROXY & CLIENT is local:

The product you are using (VMware workstation) allows you to create private network that are shared between VMs.

You should use that feature and create a new network lets say 192.168.220.0/24). Assign a static IP to the 'proxy' VM (lets say 192.168.220.1) & dynamic (and/or random) IPs to the rest of the 'client' VMs.

Configure the 'client' VMs to use 'proxy' as their network gateway. With SQUID configured as a transparent proxy (see: http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html and/or google Squid transparent proxy), you should have exactly what you are looking for.

This network setup will also allows you to set specific ACLs for each and every VMs.

Note, if you use the 'bridged network connection' option in VMware for your 'proxy' VM, that VM will have its own presence on the network. This will mean that your system running VMware workstation could also route toward it.

IF your PROXY is remote and CLIENT is local:

In that specific case, I would recommend using VPN.

In fact, you could maintain a very small local VM which create a VPN between you and your VPS and use it as a gateway (would become very similar to case local/local).

Or you could establish a new VPN automatically on VMs bootup. Using certificate authentication, this is easily done in Microsoft Windows and any GNU/Linux flavour. Careful routing would allow you to select when you want to go through the VPN... (local network vs internet).

share|improve this answer
    
Not quite. I have VPSes hosted externally; I do not host them on my private VMs. I want to use these external instances of Squid (again, not on my network) through a VM. –  Kyle Dec 13 '11 at 1:06
    
I saw your edit, but I am trying to avoid any client-side processes running that make the connection, as stated in the OP. I want the connection run through the VMWare Network Adapter. –  Kyle Dec 13 '11 at 2:17
    
The VMWare network adapter is a layer 1/2 device. It cannot do routing decision, so you will need a component inside your VM (even if it is only a routing configuration defining the gateway). It can, however be automatically applied through DHCP. The solution could be in the second paragraph for the Proxy/Remote, Client/Local 'proposition', where you have a local VM (call it 'gateway') maintaining 1 VPN for all VMs. The VPN could also be established outside the system (on your office router / another system)... –  CloudWeavers Dec 13 '11 at 2:27
    
I see, I'm not an IT whiz, but I'll look into that and await further answers. –  Kyle Dec 13 '11 at 2:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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