在服务器上部署Docker应用提示如下报错:
IPv4 forwarding is disabled. Networking will not work
没有开启IPV4的转发功能,只需要修改Linux内核参数开启即可
解决
#添加内核参数 echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf #使内核参数生效 sysctl -p #查看参数是否开启成功 sysctl net.ipv4.ip_forward
# 重启网络 systemctl restart network # 重启Docker服务 systemctl restart docker
sudo systemctl restart network && sudo systemctl restart docker