I am running virutalbox on Windows 7.
The host VM OS is Ubuntu server 12.10.
Within the Host VM I've got eth0, which talks via the NAT interface fine, and I've configured a bridge br0 such that 2 LXC containers (VMs within Ubuntu) have IPs on the same subnet and bridge to eth0.
When I set up a port forward to the host OS's IP, no problem, it forwards the request just fine.
But it fails when I set up a port forward to the IP of one of the LXC containers (the IP of one of the other interfaces connected via br0 to eth0). Actually virtualbox will not even open the listening port on my Windows 7 host.
As soon as I change the IP ot the main Ubuntu Server host, voila, we have a listening port on windows 7, but when I change the port forward to one of the LXC containers, the listening port on windows 7 is gone.
Is there some rule against port forwarding to an IP other than the hosts? In this case the host has been configured with a static IP itself.
NAT port forwarding to the hosts IP works, but not to others
-
davidparks21
- Posts: 6
- Joined: 28. Jun 2010, 17:33
- Primary OS: MS Windows 7
- VBox Version: OSE other
- Guest OSses: WinXP
-
noteirak
- Site Moderator
- Posts: 5231
- Joined: 13. Jan 2012, 11:14
- Primary OS: Debian other
- VBox Version: OSE Debian
- Guest OSses: Debian, Win 2k8, Win 7
- Contact:
Re: NAT port forwarding to the hosts IP works, but not to ot
Port forwading in Virtualbox works like a server daemon, it will try to open the port on local interfaces. If you try to create port forwarding on an IP or interface that doesn't exist, it will basically try to listen to a port on that specific IP or internface, and will obviously fail since it doesn't exist.
You are confusing this with NATing & Routing, which are the process to actually forward data and/or connections to IPs others than your own.
You are confusing this with NATing & Routing, which are the process to actually forward data and/or connections to IPs others than your own.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Manage your VirtualBox infrastructure the free way!
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: NAT port forwarding to the hosts IP works, but not to ot
I don't understand your question.
Port forwarding is a feature of NAT networking. Because the only IP address visible to the outside world is that of the host, normally the guest will not receive unsolicited messages (since they are caught by the host). But, you can set up port forwarding to change that behaviour on some host TCP ports.
My understanding may be faulty, but AFAIK the feature is only relevant to the host IP address and only when the guest is using NAT networking. There is no forwarding going on (rather: there shouldn't be) when the guest is using bridged networking. There certainly should be nothing going on if messages are received by anything except the host.
Port forwarding is a feature of NAT networking. Because the only IP address visible to the outside world is that of the host, normally the guest will not receive unsolicited messages (since they are caught by the host). But, you can set up port forwarding to change that behaviour on some host TCP ports.
My understanding may be faulty, but AFAIK the feature is only relevant to the host IP address and only when the guest is using NAT networking. There is no forwarding going on (rather: there shouldn't be) when the guest is using bridged networking. There certainly should be nothing going on if messages are received by anything except the host.
-
davidparks21
- Posts: 6
- Joined: 28. Jun 2010, 17:33
- Primary OS: MS Windows 7
- VBox Version: OSE other
- Guest OSses: WinXP
Re: NAT port forwarding to the hosts IP works, but not to ot
Seems like this is my mistake. I've successfully gotten this working, but it fails sporadically. This may or may not still be an issue with virtualbox, but I've got some people on the LXC forum looking at the issue with me. It seems that the bridged networking of the host, operating under the NAT of the virtual machine is not working always. Sometimes it does work, but sporadically the networking doesn't behave properly.