红联Linux门户
Linux帮助

Docker报错WARNING: IPv4 forwarding is disabled.的解决办法

发布时间:2017-04-05 10:06:16来源:linux网站作者:Locutus
问题:
创建容器的时候报错WARNING: IPv4 forwarding is disabled. Networking will not work.
# docker run -it -p 30001:22 --name=centos-ssh  centos /bin/bash
WARNING: IPv4 forwarding is disabled. Networking will not work.  
 
解决办法:
# vim  /usr/lib/sysctl.d/00-system.conf
添加如下代码:
net.ipv4.ip_forward=1
重启network服务:
# systemctl restart network
完成以后,删除错误的容器,再次创建新容器,就不再报错了。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/29737.html