错误:

Docker容器启动报WARNING: IPv4 forwarding is disabled. Networking will not work

解决:

cat /etc/sysctl.conf

net.ipv4.ip_forward=1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_recycle = 1

重启network:

systemctl restart network

 

验证:

sysctl net.ipv4.ip_forward

如果返回为“net.ipv4.ip_forward = 1”则表示成功了