ufw-docker icon indicating copy to clipboard operation
ufw-docker copied to clipboard

容器之间互相访问失败

Open hlf2016 opened this issue 1 year ago • 2 comments

docker0

IP :172.17.0.1

被访问容器

  • 端口映射 6665:6379

访问数据的容器

访问形式

redis-cli -h 172.17.0.1 -p 6665 

结果 connection refused

按照教程开放 6379 端口

sudo ufw allow from 172.17.0.0/24 to any port 6379 proto tcp

结果依然是 connection refused

接着在物理机开放 6665 端口

sudo ufw allow from 172.17.0.0/24 to any port 6665 proto tcp

结果 OK

可是按照教程所说 我只需开放 容器内 6379 端口 就应该可以互通的啊 不清楚 为何没有互通

hlf2016 avatar Apr 04 '23 09:04 hlf2016