Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具


Docker WARNING IPv4 forwarding is disabled. Networking will not work

Docker 评论 1 大约 362 字

具体错误

Docker启动Nginx时出现警告信息,宿主机可以通过curl访问,但外部机器无法访问Nginx

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

原因

未开启ipv4转发。

查看ipv4转发配置:

sysctl net.ipv4.ip_forward

解决

方法一

echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
systemctl restart network

方法二

echo "net.ipv4.ip_forward=1" >> /usr/lib/sysctl.d/00-system.conf
systemctl restart network
阅读 1054 · 发布于 2022-01-28

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

扫描下方二维码关注公众号和小程序↓↓↓

扫描二维码关注我
昵称:
  • fHLvlxbf 1楼
    e
    Chrome | Windows 10 2023-07-24
随便看看 换一批