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

不想你离开。 提交于 2019-11-26 20:10:24

centos7.4 启动docker容器报网络错误

报错:

[root@lvhanzhi ~]# docker run -it centos:7.4.1708
WARNING: IPv4 forwarding is disabled. Networking will not work.
#导致后面容器上不了外网

解决方法:

[root@lvhanzhi ~]# vim  /usr/lib/sysctl.d/00-system.conf
net.ipv4.ip_forward=1   #加入这一条
[root@lvhanzhi ~]# systemctl restart network    #重启网卡
[root@lvhanzhi ~]# docker run -it centos:7.4.1708   #重新启动容器
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!