Checking if the firewall is started:
systemctl status firewalld
Checking if the firewall is started:
firewall-cmd --state
Getting the default zone:
firewall-cmd --get-default-zone
Getting the active zones:
firewall-cmd --get-active-zones
Listing all rules for a specific zone:
firewall-cmd --zone=public --list-all
Adding a port:
firewall-cmd --zone=public --add-port=80/tcp
Denying a port:
firewall-cmd --zone=public --remove-port=80/tcp
Forwarding a port:
firewall-cmd --zone=external --add-forward-port=port=22:proto=tcp:toport=3753
Removing a forwarding:
firewall-cmd --zone=external --remove-forward-port=port=22:proto=tcp:toport=3753
Reloading the configuration:
firewall-cmd --reload
Saving the changes (on the fly):
by adding the --permanent parameter to the commands above
Saving the changes (snapshot):
firewall-cmd --runtime-to-permanent
Morew information here