1. Basic use of Firewalld

Start: systemctl start firewalld

Disable: systemctl stop firewalld

Check the status: Systemctl status Firewalld

Disable: systemctl disable firewalld

Systemctl enable firewalld

2. Systemctl is the main tool of CentOS7 service management tool, which integrates the functions of service and chkconfig.

Start a service: systemctl start firewalld.service

Run the systemctl stop firewalld.service command to stop a service

To restart a service, run the systemctl restart firewalld.service command

Displays the status of a service: systemctl status firewalld.service

Run the systemctl enable firewalld.service command to start a service

To disable a service during startup: systemctl disable firewalld.service

Run the systemctl is-enabled firewalld.service command to check whether the service is started upon system startup

View has launched the list of services: systemctl list – unit – files | grep enabled

View the list of services that fail to start: systemctl –failed

3. The configuration firewalld -cmd

View the version: firewall-cmd –version

View the help: firewall-cmd –help

Display status: firewall-cmd –state

To view all open ports: firewall-cmd –zone=public –list-ports

Update the firewall rule: firewall-cmd –reload

To check zone information, run the firewall- CMD –get-active-zones command

Run the firewall- CMD –get-zone-of-interface=eth0 command to view the area to which the specified interface belongs

Reject all packets: firewall-cmd –panic-on

To cancel the rejection state: firewall-cmd –panic-off

Run the firewall-cmd –query-panic command to check whether the alarm is rejected

So how do you open a port

add

Firewall-cmd –zone=public –add-port=80/ TCP –permanent (–permanent takes effect permanently.

Reload the

firewall-cmd –reload

To view

firewall-cmd –zone= public –query-port=80/tcp

delete

firewall-cmd –zone= public –remove-port=80/tcp –permanent