Table of Contents
Installing Firewalld grants a long list of commands available for configuring iptables rules. But there are a few tasks you should understand to get started with securing your server.
Below we cover:
Firewalld is pre-installed with our Cloud Server Hosting.
Basic Firewalld Commands
Firewalld Status
These Systemd and Firewalld commands affect whether or how Firewalld is running on your system.
Start Firewalld for the current session:
Enable Firewalld to always start at server boot:
Stop Firewalld for the current session:
Disable Firewalld from starting at boot:
Check whether Firewalld is running:
Check the Firewalld state – similar to systemctl status
:
The output will be running or not running.
Runtime Firewalld Configuration to Permanent
- Runtime changes are temporary and removed when the firewall restarts.
- Permanent changes are stored in configuration files.
Save --runtime
changes to your permanent configuration:
Reload Firewalld
Reload Firewalld to merge --permanent
rules to the runtime configuration (doesn’t close current connections):
Reloading will remove –runtime changes to apply the –permanent configuration.
Firewalld Zones
Firewalld zones are predefined whitelist combinations to easily apply to your system.
Default Firewalld zones:
block dmz drop external home internal public trusted work
View all Firewalld zones available:
You can also view the raw zone files:
See currently used zones:
Change the current Firewalld zone (e.g. public
):
To apply a change to a specific zone, add the following to the end of the command (e.g. public
):
Manage Services
Predefined Firewalld services use a name in lieu of port number and protocol (TCP or UDP) for easier management.
List available services to whitelist:
List currently whitelisted services:
Whitelist a service for runtime only in the current zone (e.g. http
):
Whitelist a service permanently in the current zone:
Whitelist a service permanently in a specific zone:
Remove a service permanently from a specific zone (e.g. dhcpv6-client
):
Manage Ports
Any ports not listed as a predefined service can be managed via port/protocol (e.g. 80/http).
List currently open ports:
List whitelisted ports on a specific zone:
Open a port with a specified protocol in runtime only (e.g. Mattermost):
Open a port permanently:
Remove a port in runtime only:
Remove a port permanently:
Panic Mode
Panic mode closes and blocks all incoming and outgoing connections on the machine.
If you run this while remotely connected to a machine (e.g. SSH), your session will drop and you’ll have to restart the server to regain access and reset panic mode.
Check panic mode status:
It should simply state no
.
Firewalld Files
View system configuration files which overwrite default configurations.
View default IMCP, service, and zone configurations.
Changes to these files are overwritten during firewalld updates.
Firewall-config Desktop Application
Users installing Firewalld on a Linux desktop environment can install the firewall-config GUI application to configure firewall zones on that machine.

Have any questions about Firewalld? Ask in our Community Support Center.