docker启动时报错:WARNING: IPv4 forwarding is disabled. Networking will not work

Today, after switching the server's IP from dhcp to static, the service was abnormal, and the container was restarted and found that there was a network error. Therefore, I thought that Insert picture description here
this problem should be caused by the abnormality when trying to switch the IP . You need to add some configuration, and then Restart the network

#添加配置
cat >> /usr/lib/sysctl.d/00-system.conf <<EOF
net.ipv4.ip_forward=1
EOF
#重启network服务
systemctl restart network

Guess you like

Origin blog.csdn.net/u010264186/article/details/108145408