Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I have an interface for a VPN connection (jnc0), and also a vagrant guest which talks to my machine through another separate interface (vboxnet1). My host OS is OS X Mountain Lion, and the Vagrant (VM) guest OS is CentOS 6.3.

How can I set something up so that the CentOS guest will be able to talk to hosts on the other side of the VPN through my OS X host?

share|improve this question

migrated from stackoverflow.com Jan 28 '13 at 5:47

This question came from our site for professional and enthusiast programmers.

    
Do you need external clients to connect to your VM? – Mxx Jan 28 '13 at 6:22
    
Also, can you configure your guest to establish its own separate VPN connection independent of your host? – Mxx Jan 28 '13 at 6:30
    
I want to be able to connect to the servers on the other side of the VPN from my VM (so NAT is fine), and no I can't, since the VPN features three-factor authentication, and I can only do it from my host OS. – George K. Jan 28 '13 at 14:43

If you are using Virtualbox as your VM provider, I've successfully used this snippet to enable the use of a host VPN connection on a guest VM.

config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end

You may have seen the following code snippet online which no longer works on newer versions of Vagrant:

Replaces the earlier config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .