运行Docker容器后提示WARNING: IPv4 forwarding is disabled. Networking will not work.的解决方法

打开**/usr/lib/sysctl.d/00-system.conf添加net.ipv4.ip_forward = 1**后重启网络服务

1
2
3
4
5
6
7
8
9
10
# Kernel sysctl configuration file
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.

# Disable netfilter on bridges.
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0