docker启动WARNING:IPv4 forwarding is disabled. Networking will not work. 报错解决办法

centos 7 docker 启动了一个web服务 但是启动时 报

WARNING: IPv4 forwarding is disabled. Networking will not work.

image-20210105155327414

解决办法

编辑sysctl.conf

vi /etc/sysctl.conf

添加该设置

net.ipv4.ip_forward=1

image-20210105155551809

保存退出

重启网络服务和docker

systemctl restart network && systemctl restart docker

查看是否修改成功

sysctl net.ipv4.ip_forward

(备注:返回1,就是成功)

posted @ 2021-01-05 16:10  makalo  阅读(212)  评论(0编辑  收藏  举报