今天部署docker镜像时提示:
WARNING: IPv4 forwarding is disabled. Networking will not work.
在网上找到了一种解决方法,实测有用。
编辑 /etc/sysctl.conf 文件
net.ipv4.ip_forward = 0
改为
net.ipv4.ip_forward = 1
重启network服务
systemctl restart network && systemctl restart docker
查看是否修改成功 (备注:返回1,就是成功)
[root@VM-4-14-centos etc]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1