Does VPN connection on virtual machine bypass host VPN?

8

1

I wanted to see if i could channel my traffic trough two vpns, so as an experiment i set up a windows xp virtual machine in virtualbox (using NAT shared network setting), connected the host pc(windows 7) to a vpn, and then the virtual machine to another vpn. this seams to work fine. However, my question is, is the traffic sent trough both vpn servers, or is the virtual machines vpn bypassing the host machines vpn connection? thanks.

Daniel

Posted 2013-11-06T02:19:43.760

Reputation: 517

Just off a guess I'd imaging it'd go ISP -> VPN1 -> VPN2 -> URL – Jon – 2013-11-06T02:21:46.143

Answers

7

the vm traffic does not go through the host VPN. what the VM does is creating a virtual nic, so the vpn software on host looks away from that nic. it's exactly the same has having two nic cards and telling the vpn to use the interface/ip from card X. actually it's just that case, only one card is physical, the other virtual :)

you can test it another way: on a laptop or some host with 2 cards(say, one rj45, one wifi), setup your vpn, point it to one of the interfaces, and check traffic on both networks(a traceroute to somewhere will do fine)

adding a vm, from the host point of view, is just another nic( rj45, wifi, VM). if you want that interface to go through vpn, you have to tell the vpn client installed on host.

this is an old trick (as old as VMs, that is :) to use in walled networks such as work ;)
as in:
-pointy haired boss: i wanna you setup this crappy vpn so we can big brother you all day, da!!
-dilbertian slave: sure boss. i need some specialized virtual environments to test conditions of this space rocket fuel, is it ok to install a VM? (goes away and setups VM while p.h.b. scratches head. spends all day on the net)

only note i can remember, is i use vmware a lot, and virtual box has a different way to setup the virtual nics. on vmware, works out of the box.

deimosaffair

Posted 2013-11-06T02:19:43.760

Reputation: 121

0

Assuming that all traffic from the host machine is going through the VPN, you'd have the host VPN tunnel transferring the data for the VM's VPN tunnel.

So in a sense, traffic is sent through both VPNs, but the host VPN cannot see what is within the VM VPN.

Lawrence

Posted 2013-11-06T02:19:43.760

Reputation: 3 807

0

I am not that theoretical guy and will not focus on NICs and so on. I will share my personal experience. I am running a similar setup with a Windows 8 being a host, and Win2008 Server running on a VM. I have configured that VM's NIC is connected to the host system behind NAT. This is an essential condition, otherwise you might not achieve this "double tunnel" connection. If you bridge the VM's network adapter directly to the physical network interface, then you will not make it.

So your primary connection goes through your physical network interface. Then, your VM is located in a subnet (usually 192.168.x.x), using your HOST as a gateway to internet. Connecting the host to a VPN server, routes the IP traffic of the VM through the same VPN tunnel. Establishing a second VPN connection from the VM will actually goes through the already existing tunnel. I already tested and results are quite good. Speeds are are bit slower, but you route your traffic through at least two gates and have encryption. In addition, you can set up a third SOCKS 5 connection via a proxy for your applications (browsers, torrent client, SSH consoles etc.) which will provide even a third layer of tunneling.

Noro

Posted 2013-11-06T02:19:43.760

Reputation: 1