First recorded several commands for linux operating system services (hereinafter all firewall service operation):
# Start Service
systemctl start firewalld
# Set the service from the start
systemctl enable firewalld
# Cancel service from the start
systemctl disable firewalld
# Stop service
systemctl stop firewalld
# Check the service status
systemctl status firewalld
# Restart the service
systemctl restart firewalld
Also, if configure exceptions on the firewall port, you can execute the following command:
# Add port exceptions (need to open the firewall service is added, need to restart the Firewall service after adding to the entry into force)
Firewall-cmd = --add-Port 8000 / tcp --permanent
# Remove port exceptions
firewall-cmd --remove-port=8000/tcp –permanent
# Docker configurations within the container to allow access to external networks (need to restart firewalld, docker to take effect)
Firewall-cmd = Trusted --permanent --zone --change-interface = docker0
# Verify the access to the external container (inspection results are normal DNS resolution)
Docker RUN --rm busybox the nslookup Baidu.com
Here are some commonly used linux network commands record:
# Verify site visit
curl http://baidu.com/
View # dns
nslookup baidu.com
# View network information
ifconfig
View Card #
ip link
# Delete NIC
ip link delete docker0
# View the routing table
ip route
# View nat table
iptables -t nat -L -n
# Enable ip forwarding
sysctl net.ipv4.conf.all.forwarding = 1
sudo the FORWARD ACCEPT iptables -P
Reference:
https://www.cnblogs.com/zl1991/p/10531726.html
https://unix.stackexchange.com/questions/199966/how-to-configure-centos-7-firewalld-to-allow-docker -containers-free-access-to- th
Reference:
https://docs.docker.com/network/bridge/
https://docs.docker.com/v17.09/engine/userguide/networking/default_network/custom-docker0/
HTTPS: //docs.docker. com / v17.09 / engine / userguide / networking / default_network / binding /