Page 1 of 1

How do I achieve 2 ip addresses using VirtualBox and VPN?

Posted: 14. Jan 2011, 03:27
by ilumins
I am running Win XP on both Host and Guest.

I am connected to a VPN (OpenVPN) and all my applications will have my VPN's ip address. I want to make some of my apps use my real ip address (instead of my vpn ip address) while the rest of my apps continue using my vpn ip address.

Here, Panagiotis instructs how to achieve this: (From Wilderssecurity)
You can achieve this with a vm acting as a gateway.

V1 for the first virtual nic
V2 for the second virtual nic
P1 for the physical nic.

Step 1 (host machine).
P1 : you do not need to modify anything
V1 : you should not do anything. This one will be used from the Virtual pc to get direct connection in internet.
V2 : This will be used for the private network between the host and the guest. Lets assume that you have an IP 192.168.195.2 for your host machine and 192.168.195.3 for your guest machine. You must use as default gateway (for the host machine) the IP 192.168.195.3 .
Step 2 (guest machine).
P1 : nothing to configure (you should not see it in the guest)
V1 : it should automatically connect in internet
V2 : it should communicate with the host through the private network and as the above example should have the IP 192.168.195.3.


After you configured the above just use ForceBind to force the applications to use the V2 nic (for the programs that you cannot configure the proxy).

For those that you can modify the proxy settings, use as proxy the IP of the V2 of the guest machine (e.g. 192.168.195.3).

Panagiotis


I've been trying to set this up on my PC but so far I can't seem to make it work. So far I set up 2 NICs for my VM (Bridged and Host). Next I am trying to do Step 1, V2 instructions but here is where I don't know if I am doing it correctly:

I go to Network Connections, and go to VirtualBox Host Only Network's properties, TCP/IP Properties, then would I change the default gateway to my guest's IP? (let's say this ip address is 192.168.195.3). And would I find this ip address by running ipconfig /all on my guest or host?

Then I go to firefox and would change the proxy settings to this same ip address (192.168.195.3), and then what do I put in as the port?

Does anyone know what I am doing wrong and how I can correctly implement this? I would really appreciate it, thanks!

Re: How do I achieve 2 ip addresses using VirtualBox and VPN?

Posted: 15. Jan 2011, 13:58
by Sasquatch
Please go to the OpenVPN forums. This is clearly a question for them than for us. We don't deal with VPN configurations and routing. You have this issue with both a VM and a native system, so it's got nothing to do with VirtualBox. Make sure you tell them you're trying this with some sort of gateway service, so they know the machines are like physical ones.