2

I have a VirtualBox VM configured to route all of its traffic through a VPN (using an OpenVPN script and iptables, but that should not be relevant for the purposes of this question).

I would like to configure a Debian VM to only connect through this VPN VM, which I intend to do using an internal network.

(eth0)

VPN VM

(internal network)

Debian VM

I have enabled the two adapters necessary to do this for the VPN VM. One for the VPN VM to connect to the internet, and the other for the internal network.

ifconfig in the VPN VM only shows eth0, the interface used for the internet connection adapter, and tun0, which I assume is the VPN tunnel. Not sure if this is relevant or not.

How can I find the relevant IP addresses of the VPN VM?

Which entries do I need to add in /etc/network/interfaces in the Debian VM so the connection works?

closed as unclear what you're asking by Julie Pelletier, sam, mdpc, G-Man, Thomas Dickey Aug 30 '16 at 0:39

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    If you know anything about networking, you should know that you are not providing any useful information. How is their network configured in Virtualbox? Do they use local static IPs? How are you planning to redirect the traffic? As it is, this is too broad to be considered a question. It's closer to what an inexperienced user would tell a consultant to do it at 80$ per hour, which may be your best bet if you can't provide more details. – Julie Pelletier Aug 29 '16 at 17:56
  • @Julie Pelletier Edited. Is it still missing any important information? They do use local static IPs, I believe I need to know the relevant IP addresses of the VPN VM, however I do not know how to find them. I have described the VirtualBox configuration already. By redirecting the traffic, I assume you mean redirecting it to the VPN. I have used iptables but I don't see how is it relevant for this question. The VPN connection works, I am only asking how to configure the internal network between the two VMs so one connects through the other. – anonymous Aug 29 '16 at 18:32
  • After re-wording, I think this question now contains enough relevant information to no longer have the put-on-hold status associated with it. – captcha Sep 1 '16 at 1:46
1

Virtualbox makes this very easy using a connection method called 'Internal Network'.

Open Virtualbox network adapter settings for the vms and set the Internal Network. Here you can create virtual networks so that only those vm's that are on these same internal networks can see each other.

VM1 - Settings - Network - Attached To: Internal Network

then give the network a name, e.g. VPN VM

Then do the same on the router VM's network card that attaches to the first VM.

You may need to test which card is which on your router vm and you will need to set them to matching fixed ip's so they can talk to each other.

I've successfully used this setup to create 4 vm's and ran an openvpn across the two outer vms across two routers on different networks. Each leg on their separate network.

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