docker解决报错WARNING: IPv4 forwarding is disabled. Networking will not work.

报错:

[root@localhost /]# docker run -it ubuntu /bin/bash

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

解决方式:

第一步:在宿主机上执行echo "net.ipv4.ip_forward=1" >>/usr/lib/sysctl.d/00-system.conf

第二步:重启network和docker服务

[root@localhost /]# systemctl restart network && systemctl restart docker

第三步:验证是否成功

可见完美解决问题。

posted @ 2020-12-04 21:58  一天从晚上开始  阅读(93)  评论(0编辑  收藏  举报