Jump to content


Photo

How to route virtual machine connections to OpenVPN?

vmware route openvpn

  • Please log in to reply
1 reply to this topic

#1 somevpnuser

somevpnuser

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 23 February 2016 - 05:50 PM

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!

 

 



#2 zhang888

zhang888

    Donald Trump of IT/Security

  • Moderators
  • 2225 posts

Posted 23 February 2016 - 06:16 PM

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.






Similar Topics Collapse


2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users

Servers online. Online Sessions: 16178 - BW: 58399 Mbit/sYour IP: 3.91.79.74Guest Access.