NGINX容器 WARNING: IPv4 forwarding is disabled. Networking will not work.

创建容器时 报错

[root@6 ~]# docker create -it nginx
WARNING: IPv4 forwarding is disabled. Networking will not work.
cfbed2183e1fef8496bf25fc3e10239af69935749d12de0aafc93c0bc585b488
打开IPV4转发

[root@6 ~]# vi /etc/sysctl.conf
net.ipv4.ip_forward=1
重启服务

[root@6 ~]# systemctl restart network