Home > Operation and Maintenance > Docker > How to solve the problem that IPV4 cannot be used during docker port mapping

How to solve the problem that IPV4 cannot be used during docker port mapping

WJ
Release: 2020-06-09 16:33:59
Original
4171 people have browsed it

How to solve the problem that IPV4 cannot be used during docker port mapping

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.
Copy after login

Find a solution and let the network support IP4

[root@cxt ~]# vi /etc/sysctl.conf
Copy after login

Add the following code:

net.ipv4.ip_forward=1
Copy after login

Restart the network service

[root@cxt ~]# systemctl restart network
Copy after login

View the modification results (ip_forward=1 indicates success)

[root@cxt ~]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template