Mikey’s Linux Field NotesAll topics

GUIDE 13 / SECURITY

Firewalls

Inspect zones, ports, runtime rules, and saved network policy.

2 quick lessons · Examples to adapt to your server
In this guide
Inspect firewalld without changing itAdd an intended service persistently

Commands use class paths and example filenames. Replace placeholders and inspect the target before making changes.

01

Inspect firewalld without changing it

A zone groups rules for interfaces or source addresses. Named services map to ports and other settings; an allowed port does not mean a process is listening.

COMMANDS & EXAMPLES
systemctl is-active firewalld
sudo firewall-cmd --get-active-zones
sudo firewall-cmd --zone=public --list-all
sudo firewall-cmd --permanent --zone=public --list-all
sudo firewall-cmd --info-service=https
Field note

Runtime rules are active now. Permanent rules are saved for future loads. Reloading replaces runtime settings with permanent settings, so a temporary allowance disappears.

02

Add an intended service persistently

These commands change firewall policy. Use them only when HTTPS is an intended public service and nginx is configured for it. Adding to both configurations avoids replacing unrelated runtime rules with a reload.

COMMANDS & EXAMPLES
sudo firewall-cmd --zone=public --add-service=https
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --zone=public --query-service=https
sudo firewall-cmd --permanent --zone=public --query-service=https
Field note

Retain SSH access when changing remote firewall rules. Docker-published ports can use separate forwarding rules even when absent from the public zone’s port list.