Docker Community Forums

Share and learn in the Docker community.

Docker containers use a bridge network with a Class B subnet, how can I access these containers from my Class C subnet LAN?

Hi all.

I had a bit of trouble of connecting to containers using a bridge and vpn


Then I realised the bridge network has a different subnet (172.17.0.0/24) to what I was trying to connect to. I was trying to connect to the IP address of the machine running docker, not the Docker Bridge IP.

I want to access the containers using this bridge from my local Class C subnet.

For example I want to go 192.168.1.x:portnumber on a machine in my lan access these containers.

In my VPN run command I included the port numbers

Currently I have no way of doing so as they all use a class B subnet which runs internally on the PC running docker.

Any helps and best guidance are much appreciated

Edit: Facepalm emoji. I realised the port forward I gave to my VPN was in the wrong place of the docker run command. It was at the end of the command yet my VPN logs still said the port was forwarded. Added it to the front of the command and now its all good
Thanks