当前位置: 代码迷 >> 综合 >> docker WARNING: IPv4 forwarding is disabled. Networking will not work.
  详细解决方案

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

热度:95   发布时间:2024-01-21 06:34:40.0
创建docker registry的时候报错:

[root@master ~]# docker run --name registry_server -d -p 5000:5000 -v /registry:/tmp/registry registry
WARNING: IPv4 forwarding is disabled. Networking will not work.
a93d14f536d31b3edfd847f12c8e1115bb75bc2b202fb44f761c2e14c2018a6b


解决办法:
# vi /etc/sysctl.conf
或者
# vi /usr/lib/sysctl.d/00-system.conf
添加如下代码:
    net.ipv4.ip_forward=1

重启network服务
# systemctl restart network

查看是否修改成功
sysctl net.ipv4.ip_forward

如果返回为“ net.ipv4.ip_forward = 1 ”则表示成功了
  相关解决方案