Product SiteDocumentation Site Configuring the Firewall using the command line tool, firewall-cmd

The command line tool firewall-cmd is part of the firewalld application which is installed by default. You can verify that it is installed by checking the version or displaying the help output. Enter the following command to check the version:
~]$  firewall-cmd -V, --version
Enter the following command to view the help output:
~]$  firewall-cmd -h, --help
We list a selection of commands below, for a full list please see the man page, man firewall-cmd(1).


In order to make a command permanent or persistent, add the --permanent option to all commands apart from the --direct commands (which are by their nature temporary). Note that this not only means the change will be permanent but that the change will only take effect after firewall reload, service restart, or after system reboot. Settings made with firewall-cmd without the --permanent option take effect immediately, but are only valid till next firewall reload, system boot, or firewalld service restart. Reloading the firewall does not in itself break connections, but be aware you are discarding temporary changes by doing so.