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

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	#重新启动容器
posted @ 2019-08-10 17:21  吕涵之  阅读(185)  评论(0编辑  收藏  举报