Docker追加端口映射时报错WARNING: IPv4 forwarding is disabled. Networking will not work. 解决办法

今天,用docker追加”端口映射“时报错 WARNING: IPv4 forwarding is disabled. Networking will not work.,具体如下图:

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

 

解决办法

解决此报错的方法也非常简单,只需要按照如下步骤操作即可!

 

1、用VIM编辑配置文件:

vim /etc/sysctl.conf

 

2、给配置文件添加如下代码:

net.ipv4.ip_forward=1

net.ipv4.ip_forward=1

 

3、重启network服务:

systemctl restart network

 

4、查看:

sysctl net.ipv4.ip_forward

 

5、完成以后,删除错误的容器,再次创建新容器,就OK了。

    A+
发布日期:2018年11月07日 19:43:12  所属分类:Docker
最后更新时间:2018-11-08 16:17:34
头像
  • ¥ 159.0元
  • 市场价:499.0元
  • ¥ 59.8元
  • 市场价:99.8元
  • ¥ 198.0元
  • 市场价:298.0元
  • ¥ 818.0元
  • 市场价:1688.0元

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: