Results 1 to 5 of 5

Thread: How to Route all virtual machine's traffic through PPTP VPN

  1. #1
    Join Date
    Mar 2009
    Beans
    4

    Angry How to Route all virtual machine's traffic through PPTP VPN

    Hey All!

    I have a complex situation that I need to solve, I'll try to describe it the best I can, but if you need more details just let me know.

    I have Ubuntu 9.10 SERVER installed on my home server here in California, I have installed Virtualbox 3.1.4, and have created a virtual machine called MICRO, running Ubuntu Hardy JeOS. I'm using bridged network across my server eth0 nic. I can access MICRO throughout my network without any problems.

    My goal is to establish a persistent VPN connection across PPTP within the virtual machine, and route all it's traffic through the vpn tunnel. I have installed the appropriate PPTP server on my server in Europe, I have tested it on Windows XP and Mac, it works on both (routing all network traffic.)

    Within the Virtual Machine, I have already installed the apt-get package: pptp-linux, I followed the instructions found here:

    http://www.cyberciti.biz/tips/howto-...tp-client.html

    and used this as a reference:

    http://pptpclient.sourceforge.net/routing.phtml

    I've successfully managed to install the client software, setup the correct peer in /etc/ppp/peers/., and connect to my vpn such that I can access the VPN server, and all clients connected to it.

    The problem I'm having is this, my virtual machine cannot access the outside network. When I run this command while connected to the vpn:

    Code:
    traceroute google.com
    It shows the path from my virtual machine, to my router, to my modem, to my ISP and to google.com. It SHOULD show the path from my virtual machine, to my VPN server, to my dedicated servers routers, and then to google.

    This tells me that not all network traffic is not being routed.

    I found this section regarding "routing all network traffic through the VPN"

    http://pptpclient.sourceforge.net/ro...#all-to-tunnel

    I've followed their instructions, but nothing has worked.

    A few preliminary questions:

    1.) They describe two scripts, which belong in /etc/ppp/ip-up.d/ and ip-down.d/ respectively. Following the previous tutorial, I created a route-traffic script, (which i made executable.) Should I add this code to my existing route-traffic script? Or make a new script? Does it matter what I name it?

    2.) Does the fact that this machine is a virtual machine using bridged networking add some nuance I'm not recognizing and not able to read a tutorial about appropriately?

    NOTE: I have done NOTHING in terms of networking commands locally, either on my router or the host machine. If there is some routing that needs to occur WITHIN my network in order for this to work, I have no idea what needs to be done.

  2. #2
    Join Date
    Mar 2009
    Beans
    4

    Re: How to Route all virtual machine's traffic through PPTP VPN

    here is the output of ip route before I connect to the VPN:

    Code:
    192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.4 
    default via 192.168.1.1 dev eth0  metric 100
    here is the output AFTERwards.

    Code:
    192.168.0.1 dev ppp0  proto kernel  scope link  src 192.168.0.234 
    192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.4 
    default via 192.168.1.1 dev eth0  metric 100
    My home network, is located at the address: 192.168.1.1

    My VPN is 192.168.0.1 and issues ips such as 192.168.0.234-237 to connected VPN clients.

  3. #3
    Join Date
    Jul 2007
    Location
    South San Francisco, CA
    Beans
    400
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to Route all virtual machine's traffic through PPTP VPN

    As I understand it, the vm guest, while in bridged mode, is using the exact same network parameters of the host os.

    So, from what I understand of your post, you just need to start your vpn tunnel at your host os's connection, as you indicated, eth0.

    Then from what I understand from all this, the vm guest os should also route through the vpn tunnel via the bridged network.

    Hope that helps.
    Laptop: CPU: Intel i5 430m RAM: 4gb DDR3 GPU: Ethernet: Broadcom BCM57780 WiFi: Atheros AR928X
    Desktop:

  4. #4
    Join Date
    Mar 2009
    Beans
    4

    Re: How to Route all virtual machine's traffic through PPTP VPN

    Thank you for the response,

    If I understand you correctly, you'd like me to try these same procedures on the host machine? I'll try it, but the whole reason I wanted to do this in a virtual machine, is so that the host machine could remain within my network while the virtual was over the VPN.

  5. #5
    Join Date
    Jul 2007
    Location
    South San Francisco, CA
    Beans
    400
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to Route all virtual machine's traffic through PPTP VPN

    Quote Originally Posted by snowbourne View Post
    Thank you for the response,

    If I understand you correctly, you'd like me to try these same procedures on the host machine? I'll try it, but the whole reason I wanted to do this in a virtual machine, is so that the host machine could remain within my network while the virtual was over the VPN.
    You should still be able to connect to your network, while connected to to the vpn.

    You may be able to set up the vpn on the guest, without setting it up on the host. I'm not sure how, however. Best of luck.
    Laptop: CPU: Intel i5 430m RAM: 4gb DDR3 GPU: Ethernet: Broadcom BCM57780 WiFi: Atheros AR928X
    Desktop:

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •