docker run
时报错WARNING: IPv4 forwarding is disabled. Networking will not work.
的解决办法:
$ vim /etc/sysctl.conf
添加net.ipv4.ip_forward=1
,保存退出,重启 network 服务:
$ systemctl restart network
运行命令
$ sysctl net.ipv4.ip_forward
如果返回
net.ipv4.ip_forward = 1
则表示问题解决成功。