Docker and virtual machine cannot communicate

problem encountered:
docker and qemu virtual machines are deployed on the same machine. Docker containers and virtual machines are not in the same network segment, and both containers and virtual machines are connected to the host through bridge.
Host ping container and virtual machine can be ping connected, virtual machine and container ping host can also be connected, container ping virtual machine can also be ping connected, whereas virtual machine ping container ping cannot be connected.
you can ping the docker0 network port connected by the container in the virtual machine. It is strange that the docker0 network port has been grabbed, but no packets have been caught.
what is the reason for asking the boss for an answer? How can a virtual machine communicate with a container? Thank you very much


you need to open the communication port of the docker container (- p,-- publish).

by default, containers under docker bridge can access each other without restrictions, while external access is blocked.

refer to
https://docs.docker.com/netwo...
https://developer.ibm.com/rec...

Menu