Can't reach docker container from VM

Another issue with losing the information held in the old community: https://forum.qnap.com/viewtopic.php?t=170449

I have several docker containers setup behind the normal NAT bridge. I want it this way, I don’t want them on the network because then I would need a VLAN for them and the virtual switch scenario for QNAP doesn’t make it simple to add VLANs to interfaces without also losing access to VLAN1 on the interface. I can access these containers through their port numbers just fine from any computer that should have access from LAN. The issue I have is that I now have a Virtualization Station VM that also needs to reach one of the Docker containers. Like what I imagine that thread was about, you can’t reach a Docker container from the VM. I can reach the QNAP web interface just fine, SMB and other services hosted on the NAS too. But not Docker containers hosted on the NAS. Any solutions to this?

It’s likely a routing issue. So in the Virtualization Station VM, you select the NIC you wish to use for communication. Then in the VM, you can set your address up on your LAN, etc.

First you want to check your routing table on the VM. For example in Windows this is route print from a command prompt. Commands on Linux are likely different. You need to see how the subnets for the containers are set up as far as routing. We can then add manual routes if need be after that.

To further analyze your system environment and network configuration, could you please provide the following information:

  1. A screenshot of your Virtual Switch settings

  2. Details on what is running on Docker (Container Station)

  3. The OS version of your Virtual Machine

This information will help us identify issues. Thank you for your cooperation!

Not sure why I didn’t think of the routing but that was it :slight_smile:. Thanks for jiggling the memory. The linux VM is using my standard infrastructure VLAN and obviously communicates to my main router. 172.29.20.0/24 is the particular docker network I was trying to reach. By running “ip route add 172.29.20.0/24 via 192.168.x.x dev ens2” where 192.168.x.x is the IP of the QNAP and ens2 is the name of the ethernet port of my Linux VM, I was able to successfully test reaching the container by its container IP. After that I just added a permanent route via Network Manager.

Thanks again :slight_smile:

1 Like