Docker:docker创建容器时报错:WARNING: IPv4 forwarding is disabled. Networking will not work.

 

创建容器时报错:

WARNING: IPv4 forwarding is disabled. Networking will not work.

# docker run -it -p 30001:22 --name=centos-ssh  centos /bin/bash

WARNING: IPv4 forwarding is disabled. Networking will not work.  

 

解决方法:

修改 /usr/lib/sysctl.d/00-system.conf 文件

#编辑文件
vim  /usr/lib/sysctl.d/00-system.conf

#添加下面配置
net.ipv4.ip_forward=1

#重启network服务
systemctl restart network

 

posted @ 2020-03-27 10:37  怒吼的萝卜  阅读(274)  评论(0编辑  收藏  举报