1

As the title. I can only access my docker container from the host when docker0 in promiscuous mode, even I had stopped my firewalld.service.

I start the container by this command docker run -p 9000:80 --name nginx --rm nginx.
And when I try to connect to the server: curl 127.0.0.1:9000, it returns: Recv failure: Connection reset by peer

But if I run tcpdump on the docker0 like this:
sudo tcpdump -i docker0
everything just works as expected. After some searching, I found the tcpdump command convert the docker0 interface to promiscuous mode.

my host system: centos-release-7-7.1908.0.el7.centos.x86_64
Docker version: 19.03.8

欧阳维杰
  • 1,608
  • 1
  • 14
  • 22

1 Answers1

1

Finally, I find a solution! It turns out to be a bad interface. I have to remove the docker0 interface and restart the docker service. Then the problem just disappears!

sudo ip link delete docker0
sudo systemctl restart docker.service
欧阳维杰
  • 1,608
  • 1
  • 14
  • 22