Hello,
Is there a way to select the host's interface (IP) on which the NAT will be performed ? I have a linux box with multiple interfaces and I do not want to NAT the HostPort on all interfaces.
I've been looking on the docs and the VirtualBox source code and I have found nothing like that.
Thank you,
G.
-- Later edit:
Well, it seems that VBox will use INADDR_ANY for NAT (source: src/VBox/Devices/Network/slirp/socket.c), function solisten():
addr.sin_addr.s_addr = INADDR_ANY;
Would it be very complicated to add an extra attribute like HostAddress in order to let the user choose the host's local IP for NAT ?
Select host's NAT interface
I'm afraid don't really understand your answer. I am using NAT networking for my guest as I can not use bridged networking. What do you mean by 'bind the guest interface' ? Are there any configuration options for VirtualBox that I'm missing ?
-- later edit:
Well, I have found a solution to my problem. I was looking to forward a TCP port (not UDP). The solution was to use Host Interface Networking (HIF).
-- added a vbox0 network interface to let the guest communicate with the host
-- from the guest, using the ssh port forwarding I have forwarded the remote port on the host to the local port on the guest. The ssh binds only in 127.0.0.1 on the host.
-- using simpleproxy (a simple TCP proxy), I am forwarding the port from a public interface to 127.0.0.1.
Voila.
I will keep this setup until I will find some spare time to patch virtualbox to add a HostAddress parameter for NAT. Maybe an official developer could add this feature on the next release.
-- later edit:
Well, I have found a solution to my problem. I was looking to forward a TCP port (not UDP). The solution was to use Host Interface Networking (HIF).
-- added a vbox0 network interface to let the guest communicate with the host
-- from the guest, using the ssh port forwarding I have forwarded the remote port on the host to the local port on the guest. The ssh binds only in 127.0.0.1 on the host.
-- using simpleproxy (a simple TCP proxy), I am forwarding the port from a public interface to 127.0.0.1.
Voila.
I will keep this setup until I will find some spare time to patch virtualbox to add a HostAddress parameter for NAT. Maybe an official developer could add this feature on the next release.
Hi, I'm looking to do the same thing, but how is it possible? Does it mean, it's possible if it gets implemented in the future?
In the VBoxManage command, I found there is GuestIP parameter to set, but no HostIP to set to bind the port forwarding on the host interface.
I'm using a Mac as a host OS, so there is nothing but NAT networking available and hope the host IP binding will be possible.
In the VBoxManage command, I found there is GuestIP parameter to set, but no HostIP to set to bind the port forwarding on the host interface.
I'm using a Mac as a host OS, so there is nothing but NAT networking available and hope the host IP binding will be possible.