Original address: https://www.cnblogs.com/moxiaoan/p/5683743.html 1, FIREWALLD Basic use Start: Systemctl start firewalld off: Systemctl stop FIREWALLD View status: Systemctl status firewalld boot disabled: systemctl disable FIREWALLD power on: systemctl enable FIREWALLD 2.SYSTEMC TL is the main tool in CentOS7 's service management tool that incorporates the functionality of the previous services and Chkconfig.
Start a service: Systemctl start Firewalld.service
Close a service: Systemctl stop Firewalld.service
Restart a service: Systemctl restart Firewalld.service
Displays the status of a service: Systemctl status Firewalld.service
Enable a service at boot: Systemctl enable Firewalld.service
Disable a service at boot: systemctl disable Firewalld.service
Check if the service is booting: Systemctl is-enabled firewalld.service
To view a list of services that have been started: Systemctl List-unit-files|grep enabled
To view a list of services that failed to start: Systemctl--failed
3. Configure Firewalld-cmd
View version: Firewall-cmd--version view Help: Firewall-cmd--help display Status: Firewall-cmd--state View all open ports: Firewall-cmd--zone=public-- List-ports Update firewall rules: Firewall-cmd--reload View area information: Firewall-cmd--get-active-zones View specified interface zone: Firewall-cmd-- Get-zone-of-interface=eth0 reject All packages: Firewall-cmd--panic-on de-deny status: Firewall-cmd--panic-off View reject: Firewall-cmd-- Query-panic How do I open a port? Add Firewall-cmd--zone=public --add-port=80/tcp--permanent (--permanent permanent, no failure after this parameter restart) Re-loadingFirewall-cmd--reloadViewfirewall-cmd --zone= public --query-port=80/tcp Delete Firewall-cmd--zone= public --remove-port=80/tcp--permanent
CentOS7 using FIREWALLD to turn off firewalls and ports