I have a computer, let's call it linux@home. I have a dedicated distant linux server, let's call it linuxHost@datacenter. I have a virtualbox virtual machine running windows 7 on the dedicated server, let's call it windowsGuest@datacenter.
I set up a NAT network interface on windowsGuest through virtualbox manager.
windowsGuest@datacenter is running a service that needs to access an sql database on linuxHost@datacenter, and that works fine. The same service on windowsHost needs to listen to connections on an udp port, let's say 12345. windowsGuest can access internet, web browsing works properly (doesn't need to, but that works fine).
So, now i need linux@home tu run a client application that connects on udp port 12345 on windowsGuest@datacenter. What i did is configure a port forward on the NAT network i use for windowsGuest :
-host ip : 127.0.0.1
-host port : 12346
-protocol : UDP
-guest ip : 10.0.2.4 (which is windowsGuest@datacenter ip address)
-guest port : 12345
I expect that any connection on linuxHost@datacenter on UDP port 12346 would be forwarded to windowsGuest@datacenter UDP port 12345, but that doesn't seem to happen.
a few more information :
- windowsGuest@datacenter's firewall is turned OFF
- linuxHost@datacenter runs iptables and is configured to allow any connection from linux@home, both tcp and udp.
- linuxHost@datacenter 's iptables doesn't log any blocked packets.
- I don't want to turn off iptables since linuxHost@datacenter is running other services and i don't want to expose that.
- I cannot test the client application on linuxHost@datacenter
What did I do wrong? Should i manually forward connections from internet to linuxHost@datacenter on port udp 12346 to 127.0.0.1:12345? should i configure the NAT port forwarding differently? Am i totally wrong and that's not the way i should manage this situation?
Thanks to this answer i could manage what i wanted. I had to modify my NAT port forward in the virtualbox manager preferences. The host ip field can be left blank, so that connections from any ip address would be forwarded to the guest.