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

  

相关文章:

  • 2021-10-12
  • 2021-11-24
  • 2021-10-30
  • 2022-12-23
  • 2021-07-20
  • 2021-07-23
  • 2021-10-28
猜你喜欢
  • 2021-08-31
  • 2021-06-18
  • 2021-11-24
  • 2022-02-19
  • 2022-03-05
  • 2022-12-23
相关资源
相似解决方案