docker启动WARNING:IPv4 forwarding is disabled. Networking will not work.
docker启动容器报错IPv4 forwarding is disabled. Networking will not work.
[root@localhost ~]# docker run -p 3376:3306 -d mysql WARNING: IPv4 forwarding is disabled. Networking will not work. 51d6a8a733e42c7c7c2188aa37ef2126dc1d403ff3de7151f6e7e4b95bb8af2d
解决办法:
[root@localhost ~]# vim /etc/sysctl.conf
net.ipv4.ip_forward=1 #添加这段代码
#重启network服务
[root@localhost ~]# systemctl restart network
#查看是否修改成功 (备注:返回1,就是成功)
[root@localhost ~]# sysctl net.ipv4.ip_forward net.ipv4.ip_forward = 1
-----------------------有任何问题可以在评论区评论,也可以私信我,我看到的话会进行回复,欢迎大家指教------------------------
(蓝奏云官网有些地址失效了,需要把请求地址lanzous改成lanzoux才可以)