How to solve the problem that IPV4 cannot be used when docker port mapping?
CentOS7 Docker starts a web service and uses port mapping to report an error:
WARNING: IPv4 forwarding is disabled. Networking will not work.
Find a solution and let the network support IP4
[root@cxt ~]# vi /etc/sysctl.conf
Add the following code:
net.ipv4.ip_forward=1
Restart the network service
[root@cxt ~]# systemctl restart network
View the modification results (ip_forward=1 indicates success)
[root@cxt ~]# sysctl net.ipv4.ip_forward net.ipv4.ip_forward = 1
Related references:docker tutorial
The above is the detailed content of How to solve the problem that IPV4 cannot be used during docker port mapping. For more information, please follow other related articles on the PHP Chinese website!