Add to
firewall-cmd --zone=public --add-port= 8080 /tcp --permanent (--permanent takes effect permanently, it will fail after restart without this parameter)
reload
firewall-cmd --reload
Check
firewall-cmd --zone=public --query-port=8080/tcp
delete
firewall-cmd --zone=public --remove-port=8080/tcp --permanent
Check if firewall is running
The following two commands can be
systemctl status firewalld.service
firewall-cmd --state
Check which ports are currently open
In fact, a service corresponds to a port, and each service corresponds to an xml file under /usr/lib/firewalld/services.
firewall-cmd --list-services