Hands-on Lab·Linux Foundation Certified System Administrator
The firewall, on both families
Two distributions, two firewall front ends, one kernel underneath. This guide shows both, explains the runtime-against-permanent split that catches everyone on firewalld, and demonstrates the one habit that stops you locking yourself out of a remote machine.
Networking Guide 26 of 38 Intermediate
- PlatformsUbuntu 26.04 LTS + AlmaLinux 10.2
- LVM2.03.31 (Ubuntu) / 2.03.36 (AlmaLinux)
- nftables1.1.6 (Ubuntu) / 1.1.5 (AlmaLinux)
- TimeAbout 18 min
ufw 0.36.2 with nftables 1.1.6 on Ubuntu, installed but inactive by default. firewalld with nftables 1.1.1 on RHEL 10, running by default. Both write nftables rules; neither uses iptables directly any more.
- Firewallufw 0.36.2 enabled but reporting inactive / firewalld active
- Network confignetplan + systemd-networkd / NetworkManager 1.56.0
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LFCS-A01 | 192.168.0.70 | Ubuntu 26.04 LTS | Primary host - most guides run only here | 2 Core | 4 GB | 50 GB |
| LFCS-C01 | 192.168.0.72 | AlmaLinux 10.2 | The other distribution - dnf, firewalld and NetworkManager | 2 Core | 4 GB | 50 GB |
This guide includes
Use this for the firewall marks on either distribution. This matters because a firewalld rule added at runtime disappears on reload - the runtime and permanent split is what catches everyone.
- asking each host what its firewall is doing, over one shared kernel
- finding that rules exist before the firewall is switched on
- turning it on without losing the host
- removing rules by number, and resetting
- meeting the firewalld runtime and permanent split, and making a rule permanent properly
Before you start
- guide 29 - know what is listening before you filter it.
-
Two front ends, one kernel
-
Rules exist before the firewall does
-
Turning it on without losing the host
-
Removing rules, and resetting
-
firewalld, and the split that catches everyone
-
Making a firewalld rule permanent, properly