WARNING: IPv4 forwarding is disabled. Networking will not work

启动docker容器时报错,解决方案如下:

step1:

打开系统配置文件:

[root@centos7-1 ~]# vi /etc/sysctl.conf

step2:

在打开的文件中添加下面这句话:

net.ipv4.ip_forward=1

WARNING: IPv4 forwarding is disabled. Networking will not work

step3:重启网络服务:

[root@centos7-1 ~]# systemctl restart network

step4:检查是否修改成功:

[root@centos7-1 ~]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1   #  出现这句话说明修改成功

step5:重新启动容器即可

WARNING: IPv4 forwarding is disabled. Networking will not work

上一篇:js--你需要知道的字符串使用方法(含es6及之后)


下一篇:HTML值中src和href的区别