Firewalld Firewall configuration
Check the firewall status first
sudo systemctl status firewalld
To disable the firewall, run the
sudo systemctl stop firewalld
To enable the firewall, run the following command:
sudo systemctl start firewalld
To sum up:
To check the firewall status, run the sudo systemctl status firewalld command.
You can enable the firewall in either of the following ways: sudo systemctl start firewalld; The other option is that the system does not restore to the original status after being restarted. Run the sudo systemctl enable firewalld command. This command takes effect only after being restarted.
You can disable the firewall in either of the following ways
sudo systemctl stop firewalld
sudo systemctl disable firewalld
Systemctl start firewalld
Systemctl enable Firewalld
Systemctl stop Firewalld #
Systemctl disable firewalld
Service firewalld restart
View version:firewall-cmd --version Query help:firewall-cmd --help Displays the status:firewall-cmd --state Displays all open ports:firewall-cmd --zone=public --list-ports Update firewall rules:firewall-cmd --reload Displays the region information:firewall-cmd --get-active-zones Check the zones of the specified interface.firewall-cmd --get-zone-of-interface=eth0Reject all packages:firewall-cmd --panic-onCancel reject status:firewall-cmd --panic-offCheck whether to reject:firewall-cmd --query-panicfirewall-cmd --zone=public --add-port=80/ TCP --permanent (--permanent takes effect permanently. If this parameter is not specified, the parameter will become invalid after restart.firewall- CMD - reload to seefirewall-cmd --zone= public --query-port=80TCP/deletefirewall-cmd --zone= public --remove-port=80/tcp --permanent
Copy the code