Bridge VirtualBox host-only network with Juniper VPN network on OS X

forwardingosx-snow-leopardroutevirtualboxvpn

I'm trying to setup a VM which should be able to utilize the VPN connection of my host. The VM is running Debian Lenny and the host is OS X SL. For the VPN connection I use Juniper Network Connect which creates a new virtual interface named 'jnc0' when connected.

The purpose of the VM is for software development, and ideally it needs to satisfy multiple scenarios:

  1. Offline.
  2. Online without VPN connection.
  3. Online with VPN connection.

I have mostly fulfilled the first two by having two network interfaces setup for my VM. One bridged with the Airport interface on my host, and one host-only used for basic access from the host to the guest ('vboxnet0'). The guest is able to access the internet through the bridged connection, while two-way communication between host and guest for ssh, webserver, etc., works over the host-only connection.

Since Network Connect sets up a new virtual interface for the VPN connection on the host, the bridged connection with the airport doesn't give the guest access to VPN. What I'd like to do, is to setup a new host-only network ('vboxnet1') and a route between the jnc0 and the vboxnet1 to give the guest access to VPN. What I don't know is if that's feasible or not.

I also welcome better solutions/suggestions on how to accomplish this.

Best Answer

I have the exact same setup as your, it works fine with vpn on/off. The only difference is I have one NAT adapter and one Host-only Adapter. The Nat is for all traffic and the Host-only allows me to access the vm via a 192.168.56.xxx address.