1, see the firewall service status
systemctl status firewalld
Appears Active: active (running) cut highlighted it means is activated state.
Appears Active: inactive (dead) in gray stop, look at the words will do.
2, see the firewall status
firewall-cmd --state
3, turn on, restart, shut down, firewalld.service service
# # # Restart open closed
service firewalld start
service firewalld restart
service firewalld stop
4, see the firewall rules
firewall-cmd --list-all
5, query, open and closed ports
# Query port is open
firewall-cmd --query-port=8080/tcp
# 80 open ports
firewall-cmd --permanent --add-port=80/tcp
# Removal port
firewall-cmd --permanent --remove-port=8080/tcp
# Restart the firewall (firewall to restart after configuration changes)
firewall-cmd --reload
# Parameter Description
1, firwall-cmd: the operation is a tool provided for Linux firewall;
2, - permanent: expressed to be sustained;
3, - add-port: the port identifier is added;