Page 1 of 1

Bind NAT to Specific NIC (eth0, eth1)

Posted: 14. Nov 2013, 21:08
by JaST
I am sure this is simple to do, but I have been unsuccessful so far.
I want to bind VirtualBox NAT to a specific NIC. In my case I am using a Linux host with 2 NICs configured for DHCP. I would like to configure my guest OSes so that their traffic is routed only one of the NICs, but not the other.
The VirtualBox manual states in 6.4. Network Address Translation Service (experimental)
It's possible to bind NAT service to specified interface:
VBoxManage setextradata global "NAT/win-nat-test-0/SourceIp4" 192.168.1.185

This appears to bind NAT to a specific interfaces' IP address, but not the adapter itself. I would like to find a way to bind NAT to the adapter, regardless of the IP address on the adapter, more as you can do with Bridged connections.
I appreciate any search hints that might have helped me find this info and/or any ideas on making this happen.

Re: Bind NAT to Specific NIC (eth0, eth1)

Posted: 15. Nov 2013, 01:44
by BillG
Is there a particular reason why you could not set one NIC to a static IP and always use that for your vm traffic? What is the particular benefit of DHCP in this instance?

Re: Bind NAT to Specific NIC (eth0, eth1)

Posted: 15. Nov 2013, 06:48
by JaST
Because there is no good reason to set a static on the host.
To be clear, I COULD set a static on the host, but I do not want to, and can find no logical reason for it to be required.

Re: Bind NAT to Specific NIC (eth0, eth1)

Posted: 16. Nov 2013, 01:15
by BillG
Fair enough, but I doubt that you can do what you want to do without a static IP.