错误现象:
今天运行docker报错:WARNING: IPv4 forwarding is disabled. Networking will not work
,然后docker info
,看到:
解决方案:
1.vim /etc/sysctl.conf #打开文件sysctl.conf
2.net.ipv4.ip_forward=1 #添加net.ipv4.ip_forward=1
3.systemctl restart network #重制网络
验证:
再用docker info
查看,问题解决: