8

I am trying to get a (guest) VM running on my (host) machine to talk to a (remote) VM running God knows where on some server that is accessible via corporate VPN. I am able to SSH from the host to the remote machine and ping back and forth between host and remote machines while host is connected to the VPN. I am also able to ping remote machine from guest machine, and even SSH to it. But not vise versa - remote machine is unable to talk to the server running on guest. I have tried using both NAT and bridged network adapter settings on my VM, as well as messing with firewall settings on all 3 machines, up to turning it entirely off. What are your thoughts? Help would be greatly appreciated.

  • What kind of VPN are you using? And since I'm not great at VM, does the networking config bridge (or NAT to) the physical ethernet interface and not the internal logical VPN interface? – cpt_fink Nov 20 '14 at 0:45
  • Im using Cisco AnyConnect client. As for your other question - I honestly have no idea. I have a very limited understanding of virtualization. – user3746504 Nov 20 '14 at 0:51
  • Can you install the VPN client on the VM guest? – cpt_fink Nov 20 '14 at 4:16
  • Hypothetically - yes. But in order to do that Id need an installation package(?) or at least what ever information I need to set it up, which I naturally do not have. It seems like there should be an easier, more convenient way to share a VPN connection, especially since VMWare offers network adapter NAT setting. – user3746504 Nov 20 '14 at 6:12
6

If you don't have a VPN adapter (e.g. on a Windows PPTP client), it will not show up in the list as described by cpt_fink. This works for me, though:

  • establish VPN connection in the host
  • in virtual network editor, set VMnet8 (NAT) subnet to remote (VPN) subnet
  • in NAT settings, set gateway IP to host's VPN IP
  • in VM Settings, change network adapter to custom and select VMnet8
  • Looks like working (VMWare 9, OpenVPN), but traffic still flows around VPN, not through it. I think if you use VMWare NAT option, your NAT subnet is emulated for the guest OS and has no intersection with your real subnet. – ogurets Mar 16 '17 at 17:19
2

You can actually NAT guests to a VPN adapter. If the VPN adapter is configured for split-tunneling only traffic inside the secured network will work correctly.

The steps I used to do this in VMWare Workstation 10:

Shutdown VMW.

Enable your VPN connection.

Restart VMW. Apparently it only creates its list of network adapters on startup.

Change VMNet0 to bridge to the VPN connection via Edit|Virtual Network Editor and the 'Bridged to:' dropdown list.

Make sure your guest is NAT-ed.

Profit?

Be aware that if you disconnect the VPN while VMNet0 is bridged to it, VMNet0 will disappear as its external interface no longer exists and you will have to rebuild it manually via the Virtual Network Editor.

I extrapolated from here which is several versions old.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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