1-Docker - 常见报错

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

docker启动容器时,报WARNING: IPv4 forwarding is disabled. Networking will not work.错误。

解决办法:

  1. 编辑vi /etc/sysctl.conf文件或者vi /usr/lib/sysctl.d/00-system.conf文件,添加:
net.ipv4.ip_forward = 1
  1. 重启network服务,并查看是否修改成功,返回net.ipv4.ip_forward = 1表示修改成功。
[root@C ~]# systemctl restart network
[root@C ~]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
  1. 删除之前的容器,重新创建新容器即可。

参考:Docker容器启动报WARNING: IPv4 forwarding is disabled. Networking will not work


that's all
posted @ 2020-04-17 13:38  听雨危楼  阅读(134)  评论(0编辑  收藏  举报