Firewalld

From Nick's Personal Wiki
Revision as of 09:13, 19 December 2023 by Nick (talk | contribs)
Jump to navigation Jump to search

Firewalld is a command line front end for iptables/nftables for implementing persistent network traffic rules, i.e. controlling what networking traffic is permitted, rejected, or denied. This page is for installing (if needed), configuring, and controlling Firewalld.


Installing Firewalld

Firewalld is included by default on many Linux distributions (CentOS/RHEL/Fedora), so no installation steps may be necessary on these distributions.

If it is NOT installed, the below commands will install it:

Ubuntu/Debian

To update the system and then install the firewalld packages:

sudo apt update && sudo apt install firewalld

To disable UFW, another firewall solution included in Ubuntu/Debian distributions:

sudo ufw disable


Controlling The Firewalld Service

To start Firewalld and enable it to start itself on boot:

sudo systemctl start firewalld
sudo systemctl enable firewalld

To stop Firewalld and disable it to longer start itself on boot:

 sudo systemctl stop firewalld
 sudo systemctl disable firewalld

To check the status of Firewalld:

sudo firewalld-cmd --state

This command should only output 'running' or 'not running'.

To check the status of the daemon for Firewalld:

sudo systemctl status firewalld

Configuring Firewalld

Configure By Service

Configure By Port/Protocol

Configuration Sets

Runtime

Permanent

Firewall Zones

Working With Rulesets

More Info