Home >Operation and Maintenance >Docker >How to configure docker to support ipv4

How to configure docker to support ipv4

尚
Original
2020-03-31 10:45:025277browse

How to configure docker to support ipv4

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 to make 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

For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.

The above is the detailed content of How to configure docker to support ipv4. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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