1-Docker - 常见报错
WARNING: IPv4 forwarding is disabled. Networking will not work.
docker启动容器时,报WARNING: IPv4 forwarding is disabled. Networking will not work.
错误。
解决办法:
- 编辑
vi /etc/sysctl.conf
文件或者vi /usr/lib/sysctl.d/00-system.conf
文件,添加:
net.ipv4.ip_forward = 1
- 重启network服务,并查看是否修改成功,返回
net.ipv4.ip_forward = 1
表示修改成功。
[root@C ~]# systemctl restart network
[root@C ~]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
- 删除之前的容器,重新创建新容器即可。
参考:Docker容器启动报WARNING: IPv4 forwarding is disabled. Networking will not work
that's all