Can't access bridged VirtualBox port from the internet without port forwarding from the host
Posted: 18. Jan 2021, 11:54
I am encountering a strange issue which I cannot understand and it is probably due to my limited understanding of how VB deals with networks.
I have a virtual box instance running in bridge mode (hostname docker). Actually it is running in nat (eth0) and bridged (eth3). I have a bunch of docker services running on it exposing various ports, say 8080. The instance is running on a host called "host"
From my local network (any host) I can access the docker:8080 nicely.
From my router, I forward port 8080 to docker:8080. I expect to be able to access public_ip:8080. However, it does not work - no traffic reaches my docker instance.
If I port forward host:8080 to docker:8080 and then my public 8080 to host:8080 (in my router), it works like a charm.
Why is that?
Recapping:
Why do I need this unnecessary port forwarding from the host to the virtual box instance?
Thanks
I have a virtual box instance running in bridge mode (hostname docker). Actually it is running in nat (eth0) and bridged (eth3). I have a bunch of docker services running on it exposing various ports, say 8080. The instance is running on a host called "host"
From my local network (any host) I can access the docker:8080 nicely.
From my router, I forward port 8080 to docker:8080. I expect to be able to access public_ip:8080. However, it does not work - no traffic reaches my docker instance.
If I port forward host:8080 to docker:8080 and then my public 8080 to host:8080 (in my router), it works like a charm.
Why is that?
Recapping:
Code: Select all
public_ip:8080 -> host:8080 -> docker:8080 YES
public_ip:8080 -> docker:8080 NOCode: Select all
host=192.168.1.99
docker:192.168.1.201
test machine: 192.168.1.161
(all in the same subnet)Thanks