Ubuntu – Route all Ubuntu traffic to Windows 7 Virtualbox with Juniper VPN

junipernetworkingUbuntuvirtualboxvpn

I have to use Juniper VPN to connect to my company's VPN. Unfortunately my company doesn't allow connections directly from Ubuntu. So I have a minimal Windows 7 VM in VirtualBox and run Juniper from there where I can successfully connect to my company's corporate network.

The idea is to use my linux to work and use virtualbox only to route all traffic through the vpn. (Using the VPN on linux is not an option)

The problem is that I don't know how to route all traffic through the vpn on the guest. (HTTP, SSH, …). I tried at port-forwarding but I don't know if it's the answer, maybe I should use virtualbox as admin to listen to < 1024 ports but it seems virtualbox is not listening to that.

Best Answer

I made it work today!

Setup is not that hard actually. I run Ubuntu 17.04 and have a Windows 7 VM.

Windows VM network setup:

adapter 1: host only (give a static ip: 192.168.56.11)
adapter 2: bridged   (got a DHCP ip from my router: 192.168.0.106)

Ubuntu setup:

wlp5s0: DHCP ip from router 192.168.0.105
vboxnet0: 192.168.56.1

I have a CheckPoint VPN connection on Windows VM.

enter image description here

Ethernet 2 = Host only
Ethernet 3 = Bridged
Ethernet 4 = VPN. This is the one you will need to share with Ethernet 2 (hostony)
  • Right-click 'Properties'
  • Sharing tab
  • Share with 'Host-only' network

Then on my Ubuntu box: (192.168.222.50 is just a host on the corporate net)

sudo route add 192.168.222.50 via 192.168.56.11

Or route an entire range

sudo route add 192.168.222.0/24 via 192.168.56.11

Also, don't forget to add your corporate DNS server to the /etc/resolv.conf!

Related Question