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

报错信息:

CentOS7中,启动docker容器的时候提示警告WARNING: IPv4 forwarding is disabled. Networking will not work.


[root@localhost ~]# docker run \
>  -e RABBITMQ_DEFAULT_USER=itcast \
>  -e RABBITMQ_DEFAULT_PASS=123321 \
>  -v mq-plugins:/plugins \
>  --name mq \
>  --hostname mq \
>  -p 15672:15672 \
>  -p 5672:5672 \
>  -d \
>  rabbitmq:3-management
WARNING: IPv4 forwarding is disabled. Networking will not work.
a4f8bd894ebd952566644601981cc147b34cad316729fe1fc6a856eda4c89914

报错原因:

CentOS的内核中的ip_forward(IP转发)是默认关闭的,需要手动打开

解决方案:

修改配置文件:

vim /usr/lib/sysctl.d/00-system.conf

追加

net.ipv4.ip_forward=1

WARNING: IPv4 forwarding is disabled. Networking will not work._第1张图片

重启网络

systemctl restart network

如何将之前报警告的docker删掉,重新启动即可

你可能感兴趣的:(报错,linux,ubuntu,mysql)