Route specific network traffic through vpn in virtualbox guest
        Posted  
        
            by 
                Sander
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by Sander
        
        
        
        Published on 2012-11-22T16:34:22Z
        Indexed on 
            2012/11/22
            17:00 UTC
        
        
        Read the original article
        Hit count: 355
        
I am running OSX with a windows server 2008 guest in Virtualbox. My goal is to route some of the network traffic in the host through the server guest. This is because the win2008 server has a VPN connection to my workplace using a Smartcard solution which can not operate on OSX.
My current set-up is like this:
OSX (Host):
- connected to the internet via en01
 
Win2008 (Guest):
- connected to the internet using NAT (lan1 in guest)
 - has a SSTP VPN connection to my workplace
 - is connected to the guest using an Host Only Adapter vboxnet0 (LAN2 in guest)
 
The important part is about the host (OSX). Primarily I want all network traffic to just go through en01. However, all traffic which can only be accessed through the VPN must go through the guest and through the VPN. I have one specific FQDN which can only be accessed through the VPN (say corp.mycompany.com).
I do not know much about networking. I thought I would be able to get it to work by
- bridging together LAN2 and LAN1 but this didn't seem to work
 - this: http://archives.aidanfindlater.com/blog/2010/02/03/use-vpn-for-specific-sites-on-mac-os-x/
 - using a loopback adapter on WinXP (when I did not have win2008 yet, but this doesn't work because I can't create a PPTP connection)
 
And I've also read about Routing and Remote Access but I have no idea on how to use this.
Can someone help me in the right direction?
© Server Fault or respective owner