Jump to content
Not connected, Your IP: 34.204.0.181
Sign in to follow this  
somevpnuser

How to route virtual machine connections to OpenVPN?

Recommended Posts

I have a vmware virtual machine and I want all network traffic to go via openvpn/airvpn.

 

One solution would be to copy the .ovpn file to the guest VM and use it there.

The problem is this approach is subject to human errors, OS failures and vulnerable to attacks.

 

So by doing this routing on the host OS it would allow to have a disposable "internet" guest Vm which you can use without having to worry about your security or identity to be compromised.

Well for a full protection you would need Tor as well. That's not what I need. But if you know how anyway then feel free to chime in.

 

 

Both my host and my guest are Linux machines.

 

Note that I have more than one VM and I only want traffic to be routed for this specific VM.

 

I would also like to know on which network modes this can be done. I mean if the VM is in NAT can this work? And what about bridged? Host only?

What are the advantages or disadvantages of each guest VM network mode in order to solve this problem?

 

Thank you!

 

 

Share this post


Link to post

On VirtualBox it can be done with this rule on host:

iptables -t nat -I PREROUTING -s 10.4.12.34 -j DNAT --to-destination 10.0.2.15

 

Where first is your OpenVPN tunnel IP and second is your NAT IP inside the guest.


Occasional moderator, sometimes BOFH. Opinions are my own, except when my wife disagrees.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...