Docker WARNING IPv4 forwarding is disabled. Networking will not work

Docker About 362 words

具体错误

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
Views: 1,412 · Posted: 2022-01-28

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

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

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


Today On History
Browsing Refresh