0
votes

I have Windows 10 host machine running VirtualBox with an Ubuntu guest having a bridge adapter @ 192.168.1.5. Also, I am running a docker container in Ubuntu with ports bound to port 8080. I can hit the 192.168.1.5:8080 just fine from within my network (e.g. from my mobile and desktop host).

However, I cannot get port forwarding on my mi424wr router to forward to the ubuntu guest @ 192.168.1.5. I can get port forwarding to work against my Windows 10 machine.

Could there be something that my router doesn't like about the ubuntu guest vm?

Edited: Here are the entries in the router security log when I try from my external ip address:

Port forward rule: 56123 -> 192.168.1.5:8080

  1. Connection Opened: TCP 192.168.1.5:8080 <-->myIp:56123 [74.96.218.140:1024] CLOSED/CLOSED local_dev NAPT Incoming STATIC UNINIT UNSECURED
  2. Connection opened: TCP 192.168.1.5:8080 <-->myIp:56123 [myIp:1025] CLOSED/CLOSED local_dev NAPT Incoming STATIC UNINIT UNSECURED
  3. Wildcard connection hooked: TCP 192.168.1.5:8080 <-->myIp:56123 [myIp:1024] CLOSED/SYN_SENT local_dev NAPT Incoming STATIC BNAPT UNSECURED
  4. Wildcard connection hooked: TCP 192.168.1.5:8080 <-->myIp:56123 [myIp:1025] CLOSED/SYN_SENT local_dev NAPT Incoming STATIC BNAPT UNSECURED
  5. Connection Opened : TCP 192.168.1.5:8080 <-->myIp:56123 [74.96.218.140:1026] CLOSED/CLOSED local_dev NAPT Incoming STATIC UNINIT UNSECURED
  6. Connection Opened: TCP 192.168.1.5:8080 <-->myIp:56123 [myIp:1026] CLOSED/CLOSED local_dev NAPT Incoming STATIC UNINIT UNSECURED
  7. Wildcard connection hooked: TCP 192.168.1.5:8080 <-->myIp:56123 [myIp:1026] CLOSED/SYN_SENT local_dev NAPT Incoming STATIC BNAPT UNSECURED

my actual ip address was replaced with "myIp"

Also, I have tested with a http-server npm package hosting a static file. It works from within my LAN, but port forwarding fails also which should negate Docker as the culprit.

1

1 Answers

2
votes

Maybe this could be because of the firewall settings on the Ubuntu VM, the Docker container, or Windows Firewall as well. Perhaps they are set to allow 192.168.*.* private addresses but not public IP addresses?
See: UFW, iptables, Docker and iptables, Windows Firewall

I would step through each firewall configuration one by one and test if you can get through after each change you make. Note that UFW is just a front end for iptables, and may or may not be enabled.

If none of this seems to help, maybe you would have more success running the Ubuntu VM in NAT mode, with port forwarding setup through Virtual Box in addition to at your router.
See: Virtual Box Networking (especially 6.3.1).