Page 1 of 1

sourcing NAT traffic: --natbindip1 not working as expected

Posted: 28. Sep 2010, 20:25
by aut0maticdan
First, my objective is to create groups of 5 virtual machines with each group bound and NAT'd to a separate host IP address. I will have multiple groups of 5 per host machine and therefor multiple host IP addresses. I am only concerned about the source of outbound traffic. I will not be port forwarding any ports to the virtual machines.

Host server: CentOS 5.5
Virtual Box Install: VirtualBox-3.2-3.2.8_64453_rhel5-1 (RPM)
Virtual Machines: WIndows XP

I'm running everything headless.

based on the info found here: http://www.virtualbox.org/manual/ch09.html#changenat (Binding NAT sockets to a specific interface)

I expected --natbindip1 to accomplish what I've set out to do.

What I've experienced:
  • - <NAT hostip="xxx.xxx.xxx.xxx"> added to the configuration xml specifying the IP I've designated with --natbindip1

    - when making a remote desktop connection, I now have to specify the IP I've designated with --natbindip1

    - all TCP and ICMP traffic from inside the virtual machine still goes out the primary interface, not the one I've specified via --natbindip1 (confirmed via tcpdump)

    - all DNS traffic (UDP) from inside the virtual machine does go out the interface I specified via --natbindip1 (confirmed via tcpdump)
So the problem for me is the TCP traffic not originating from the IP specified via --natbindip1. I am not at all married to this solution and am open to other suggestions. Based on the docs, it seemed like it would be an elegant solution to my objective.

thanks for any help you can provide

Re: sourcing NAT traffic: --natbindip1 not working as expec

Posted: 1. Feb 2013, 06:47
by pegasus
I have exactly the same problem. Only DNS traffic obeys --natbindip1. TCP and ICMP just ignore this settings.
More over --natdnsproxy is also ignored, DNS request are not proxied, I still see direct requests to DNS server from --natbindip1.

VirtualBox 4.2.6 r82870 looks like it still was not fixed :(

Re: sourcing NAT traffic: --natbindip1 not working as expec

Posted: 3. Oct 2013, 08:51
by kalo
I have still the same problem on VBox 4.2.18 r 88780: --natbindip1 is not routing all the traffic through the interface specified. Will this be corrected?

Re: sourcing NAT traffic: --natbindip1 not working as expected

Posted: 8. Aug 2016, 14:28
by piRaimi
Hey,

I'm using VirtualBox 5.0.26 (on a Linux host) and still have the same problem. The Host has 2 public IP adresses (on eth0 and eth0:0) and the VM is supposed to use the second one (from eth0:0). But TCP connections (ssh) originate from the wrong IP (the one bound to eth0).

Is this a (known) bug or am I just being too dumb?

Thanks!