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

This is for discussing general topics about how to use VirtualBox.
Locked
ilumins
Posts: 2
Joined: 14. Jan 2011, 02:59
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: 3.2.10

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

Post 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!
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

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

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Locked