SUSE docker启动容器提示“Warning:IPv4 forwarding is disabled.Networking will not work.”

在SUSE上安装好docker后启动容器时出现提示“Warning:IPv4 forwarding is disabled.Networking will not work.”
启动的容器虽然映射了端口,但是其他机器无法访问。

查看更改前的配置
sysctl net.ipv4.ip_forward

经查询需要修改如下文件
/etc/sysctl.conf

添加
net.ipv4.ip_forward = 1
然后重启network服务和docker服务即可
systemctl restart network
systemctl restart docker

查看更改后的配置
sysctl net.ipv4.ip_forward

你可能感兴趣的:(SUSE docker启动容器提示“Warning:IPv4 forwarding is disabled.Networking will not work.”)