Links: http://www.qianxingweb.com
1. Check the firewall status
# Of parameters 1, firwall-cmd: the operation is a tool provided for Linux firewall; 2, - Permanent: provided persistent represented; . 3, - the Add-Port: The port is added;
. 4, - Remove-Port: have been added to remove the port
5, - add-port = 80 / tcp: single port opening
6, - add-port = 8000-8999 / tcp: add a piece of port
systemctl status firewalld
或
firewall-cmd --state
2. Check the firewall rules:
firewall-cmd --list-all
3. Query port is open:
firewall-cmd --query-port=80/tcp
4. Open Ports:
firewall-cmd --permanent --add-port=80/tcp
After successfully added [firewall-cmd --list-all] see the [ports] configuration does not take effect
Restart the firewall: systemctl restart firewalld or view again, ports display port 80 has been configured successfully
5. Remove open ports:
firewall-cmd --permanent --remove-port=80/tcp
6. Open a while ports:
Open ports section: Firewall-cmd --permanent --add-Port = 8000-8999 / TCP
7. Restart the firewall configuration to take effect:
firewall-cmd --reload 或 systemctl restart firewalld