Community discussions

MikroTik App
 
phgachoud
just joined
Topic Author
Posts: 8
Joined: Thu Jul 18, 2019 9:33 pm

route all traffic from a VM to another which runs a VPN

Tue Aug 31, 2021 3:30 pm

Hi Folks!

I'm having 2 VM on virtualbox. I have a vpn client which is not available on linux, want to work on linux but am screwed with the vpn client which is only supported on windows.
On my current resolution which is really not ideal, I'm having /etc/host redirections for some of the hosts and ssh tunnels vm1->vm2 to make some services work.

Have 2 vms:
  • vm1 linux
    vm2 windows with a vpn client
Is there a way into my mikrotik to route all trafic from a given IP to the other IP through its VPN?

Many Thx!
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: route all traffic from a VM to another which runs a VPN

Tue Aug 31, 2021 4:15 pm

The Windows VM running the VPN client must provide "internet connection sharing" in order that you could use it as an entry point to the VPN tunnel for some other device, and you don't need a Mikrotik to facilitate such connection to the Linux VM - you simply create a virtual network with one NIC of the Windows VM and one NIC of the Linux VM, attach a DHCP client to that NIC on the Linux VM, tell the Windows to share the "internet connection" from the VPN client interface to that NIC, and let the Linux use 192.168.137.1 as the gateway for whatever traffic you need to send via the VPN (Windows use 192.168.137.0/24 as the "LAN interface" in this arrangement).

The only thing I'm not sure about is whether Virtualbox supports virtual networks where the host system doesn't participate.
 
phgachoud
just joined
Topic Author
Posts: 8
Joined: Thu Jul 18, 2019 9:33 pm

Re: route all traffic from a VM to another which runs a VPN

Wed Oct 20, 2021 2:39 pm

The Windows VM running the VPN client must provide "internet connection sharing" in order that you could use it as an entry point to the VPN tunnel for some other device, and you don't need a Mikrotik to facilitate such connection to the Linux VM - you simply create a virtual network with one NIC of the Windows VM and one NIC of the Linux VM, attach a DHCP client to that NIC on the Linux VM, tell the Windows to share the "internet connection" from the VPN client interface to that NIC, and let the Linux use 192.168.137.1 as the gateway for whatever traffic you need to send via the VPN (Windows use 192.168.137.0/24 as the "LAN interface" in this arrangement).

The only thing I'm not sure about is whether Virtualbox supports virtual networks where the host system doesn't participate.
Did read many times, but am not able to set what you are saying. Could you be more specific and point me out some documentation for that please? Thx!
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: route all traffic from a VM to another which runs a VPN

Wed Oct 20, 2021 11:06 pm

I don't understand what you don't understand :)

Here's a link on "internet connection sharing" on Windows.

Use the VPN interface as the "internet" uplink to be shared. The Windows VM becomes a router with NAT, acting as a DHCP server on its LAN side.

On the virtualbox, you need to configure a virtual switch to connect the "LAN" interface of the Windows VM with the "WAN" interface of the Linux VM.

Who is online

Users browsing this forum: Bing [Bot], Gomo, ips and 58 guests