Skip to content

[FEATURE] #3972

@sanqiy

Description

@sanqiy

1Panel 版本

1.9.6

请描述您的需求或者改进建议

Docker 干预 iptables 导致异常暴露端口的问题

请描述你建议的实现方案

方案一
安装 Docker 后, 务必编辑 /etc/docker/daemon.json(没有就新建一个), 设置 ip 为 127.0.0.1, 防止 docker 自己修改了 iptable 导致 ufw 失效. 修改完毕后执行 systemctl daemon-reload && systemctl restart docker 重启 Docker 服务.
注意, /etc/docker/daemon.json 应当是有效的 json. 下面是个参考(更多地: 开启了 IPv6 支持, 配置了 DNS. 国外服务器自行替换为 1.1.1.1, 8.8.8.8):

{
"dns":[
"119.29.29.29",
"223.5.5.5"
],
"ipv6":true,
"fixed-cidr-v6":"fd00:db8:1::/64",
"experimental":true,
"ip6tables":true,
"ip":"127.0.0.1"
}
注意: 亲测不能修改 /lib/systemd/system/docker.service 加上 --iptables=false, 否则 Docker 无法启动. 修改 /etc/docker/daemon.json 加上 { "iptables" : false } 本质一样.

或者参考这篇文章https://blog.liqiye.com/posts/919176895/

附加信息

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions