Page 1 of 1

Redirect Vbox NAT to non default interface

Posted: 29. Sep 2020, 17:48
by humanDecoded
The default interface that all traffic passes through on my linux box is: eno1 with an ip of 192.168.1.201. I also have a wireless interface at wlx9cefd5fd0db7 with ip 192.168.2.75.
In NAT configuration all the traffic from my VM passes through the Vbox NAT engine and gets pushed to the default interface eno1. I'm looking for a way to pass a specific VM's traffic to the wireless interface mentioned above instead of the default. The documentation leads me to believe this is possible using

Code: Select all

vboxmanage modifyvm "vm-name" natbindip1 <ip of interface>
but I can't get it to work. Is there something I'm missing or something I still need to configure?

I know that one way I could solve this would be to run in Bridged mode and just assign the wireless interface as the network adapter but I don't want to do that. My use case looks like this:
On my home network, all traffic on the 192.168.1.xxx subnet gets pushed through a vpn on the router (protectli box running pFsense) and all traffic on the 192.168.2.xxx subnet does not get pushed through the vpn. I'm running Whonix (routes all traffic through TOR) in Virtual Box and want to avoid the subnet using the vpn (192.168.1.xxx). The default configuration for Whonix gateway is NAT and I don't want to mess with any of the default settings the devs put in there.

How can I tell Vbox to send that VM's traffic to non-default interface while still being in NAT mode?

Re: Redirect Vbox NAT to non default interface

Posted: 29. Sep 2020, 18:03
by scottgus1
It does seem like you found the correct command.

The only caveat I see in the manual is:
Ensure that this interface is up and running before changing the NAT bind address.
Also, the '1' in the command is to affect the first adapter. Is the Whonix guest's first adapter the NAT adapter?

Re: Redirect Vbox NAT to non default interface

Posted: 29. Sep 2020, 18:18
by humanDecoded
Yes, the interface is up and running. I'm testing this on a regular linux mint vm before I mess with Whonix. When I ran in to trouble I assumed that something was wrong with my non-default interface so I tried to point the NAT traffic back to the default interface with:

Code: Select all

vboxmanage modifyvm "mint-vm" --natbindip1 "192.168.1.201"
but still nothing. What's interesting is that DNS appears to be working as when I type in an ip address in to a browser in the vm it resolves to the correct name but can't actually connect to a site.

Re: Redirect Vbox NAT to non default interface

Posted: 29. Sep 2020, 18:28
by scottgus1
I have never done this before, so we're going to have to wait for a network guru to show up.

Or find a different solution, perhaps switching your networks so the VPN is on the .2 network and leave the Whonix on .1