启动docker 端口映射时IPV4无法使用
CentOS7 Docker启动一个web服务,使用端口映射报错:
WARNING: IPv4 forwarding is disabled. Networking will not work.
查找解决方法,让network支持IP4
[root@cxt ~]# vi /etc/sysctl.conf
添加如下代码:
net.ipv4.ip_forward=1
重新network服务
[root@cxt ~]# systemctl restart network
查看修改结果(ip_forward=1表示成功)
[root@cxt ~]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1