docker容器外访问报错curl: (56) Recv failure: Connection reset by peer

搭建docker中的mysql访问宿主机端口报错curl: (56) Recv failure: Connection reset by peer,解决方法很简单,重建docker0网桥,但出现错误原因不清楚:重建docker0网桥步骤

# 停止docker
systemctl stop docker
# 安装bridge-utils
yum install -y bridge-utils 
# 关闭docker0网桥
ip link set dev docker0 down
# 删除docker0网桥
brctl delbr docker0
# 添加docker0网桥
brctl addbr docker0
# 添加网桥信息
ip addr add 172.16.10.1/16 dev docker0
# 启动docker0网桥
ip link set dev docker0 up
# 查看网桥是否正常
ip addr
# 启动docker
systemctl restart docker

docker容器外访问报错curl: (56) Recv failure: Connection reset by peer_第1张图片

 

你可能感兴趣的:(linux及开发环境部署,docker,运维,linux)