Windows – Send network traffic via a Windows VM on the same host to use corporate vpn

networkingvirtual machinevirtualboxwindows

At work we have a VPN solution that will only work on windows. I personally do not run Windows at home and run Linux (Ubuntu 14.04). I used Virtual Box to setup a Windows 7 virtual machine to run the vpn software. It works as expected.

My goal is to send my traffic on my main linux host through the windows vm so the proper traffic can be picked up by the vpn. Is this possible at all?

Best Answer

On linux you can define very accurate routing tables that allow you to be connected with several VPN toghether.

I had this problem once, and was solved here.

The problem I see in your case is mainly: "how to use windows as a router?". And probably this is not the best forum where to ask such a question...

Anyway, there are a couple of advices that I guess could be useful: the first is related to Virtualbox networking. I highly suggest you to use 2 virtual ethernet interfaces on your virtual machine:

a) the first one can be a classical NAT interface (default virtualbox), you'll use it as outgoing interface, and will be used by your VPN client

b) a bridged interface on your virtual machine, which will have an IP in the same network as your host machine (i.e. your linux machine).

You should then write routing rules on your host machine that redirect the request on a given IP range (the ones of your corporation VPN) on the virtual machine's bridged interface, i.e. you will define this IP as the gateway for the requests on that IP range.

Then (and this is where I can't help you, sorry) you should write a routing table on your windows machine that redirects all the requests coming on eth1 toward your VNP interface, which is connected to eth0.

I hope this helps. Sorry, but I'm really not an expert on Windows...

Anyway, if you find a proper solution, PLEASE: write the solution here, as it may be useful to many other people.

Related Question