This article is a mirror article of machine translation, please click here to jump to the original article.

View: 8075|Reply: 0

CentOS solves the problem that the external network cannot be accessed after the docker port is mapped to the host

[Copy link]
Posted on 2/14/2019 7:17:08 PM | | | |
Linux solves the problem that the external network cannot be accessed after the docker port is mapped to the host

Solution:

# vi /etc/sysctl.conf



or
# vi /usr/lib/sysctl.d/00-system.conf
Add code like this:
net.ipv4.ip_forward=1

Restart the network service
# systemctl restart network

Check if the modification is successful
# sysctl net.ipv4.ip_forward

If it returns "net.ipv4.ip_forward = 1", it is a success



We tried accessing the port with an extranet without any problems!





Previous:JavaScript Method
Next:Mqtt's service quality level Qos
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com