Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

firewalld

Direct answer

firewalld manages the firewall on RHEL-family systems with zones (trust levels) bound to interfaces or sources, services and ports per zone, and a runtime vs permanent configuration.

When to use this

Use it to open services or ports on RHEL/Rocky/AlmaLinux, or when an opened port is still blocked.

First 30 seconds

1. firewall-cmd --get-active-zones — zone per interface/source.

2. firewall-cmd --zone=<z> --list-all — services and ports.

3. Add: firewall-cmd --zone=<z> --add-service=https --permanent && firewall-cmd --reload.

4. firewall-cmd --list-all --permanent vs runtime — same?

5. Test remotely.

Operational verification

interface/source mapped to a zone → zone services/ports/rich rules → nftables rules → packet allowed or rejected

Evidence · next step

For Firewall → firewalld, continue with the first unproven Topic check: Read active zones, interface/source bindings, default zone and all settings for the zones/policies involved in the original flow. If that boundary is healthy, advance to the adjacent check: Compare runtime and permanent views; expand service definitions, ports, protocols, rich rules and forwarding/policy objects. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to open services or ports on RHEL/Rocky/AlmaLinux, or when an opened port is still blocked.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

7 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

firewalld config → runtime/permanent zone/policy state → interface/source selection → generated nft backend rules → netfilter verdict/NAT → socket/egress → workload

Healthy evidence: zone/source/interface mapping is unambiguous, runtime and intended permanent configuration agree, generated backend rules enforce the designed flow, and workload verification passes.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Read active zones, interface/source bindings, default zone and all settings for the zones/policies involved in the original flow.

  • Compare runtime and permanent views; expand service definitions, ports, protocols, rich rules and forwarding/policy objects.
  • Correlate backend nftables rules/counters and packet capture if zone/policy output is ambiguous or another manager is suspected.
  • Apply the smallest runtime/permanent change intentionally, verify both views after reload where needed, then repeat the original and negative regression flows.

Verification chain. firewalld config → runtime/permanent zone/policy state → interface/source selection → generated nft backend rules → netfilter verdict/NAT → socket/egress → workload

Step 3 Specialized verification Verify boundary

Inspect active zones and their interface/source bindings first, then list effective runtime services/ports/rich rules/policies. Compare permanent state separately when persistence matters. Generate a test flow and correlate firewalld/nftables counters or traces if needed. After reload, re-check zone binding and the intended rule. An “open port” in a zone is only a policy statement; verify routing, listener and application response on the target host.

Step 4 Commands Verify boundary
firewall-cmd --get-active-zones
firewall-cmd --zone=public --list-all
firewall-cmd --permanent --add-service=https && firewall-cmd --reload
Step 5 Failure modes and next checks Narrow the fault

Suspicious evidence: traffic maps to an unexpected zone, runtime/permanent states diverge, a service definition opens different ports than assumed, policy objects are ignored, or a reload changes behavior unexpectedly.

It does not show behavior outside the captured namespace, family, five-tuple, interface/direction, manager/backend, ruleset generation, conntrack/NAT state, time window or application scope. firewalld is confirmed when the original packet is mapped to the correct zone/policy and generated backend enforcement, runtime/permanent intent is coherent, and application behavior matches the resulting verdict.

Step 6 Special cases and limits Narrow the fault

Runtime and permanent state can legitimately differ, so querying only one can produce a false conclusion. A service opened in the wrong zone has no effect on the desired traffic. Backend nftables visibility is implementation detail unless you preserve firewalld ownership. Container networking or direct rules can add additional paths. Keep zone classification, firewalld policy, backend rules, route/listener and application health separate.

Step 7 Common mistakes Narrow the fault
  • Forgetting --permanent, losing rules on reload.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Changes without --permanent are lost at reload; changes with it need --reload. Check which zone an interface or source is in — a rule in the wrong zone does nothing. Rich rules allow source-specific rules.

Key checks
  • nft list ruleset — all nftables rules
  • iptables -S; iptables -t nat -S — iptables rules (if used)
  • firewall-cmd --list-all — firewalld zone settings
  • ufw status verbose — UFW rules and defaults
  • ss -tulpn — which services listen
ReferenceWhat it is1 section · depth on demand

Core model

Determine the active zone selection for the exact interface/source and distinguish runtime from permanent state. Expand services and rich rules to their concrete protocol/port/source meaning, inspect policies for inter-zone/forwarding flows, then correlate generated backend rules and counters/capture when the zone view does not explain behavior.

ReferenceImportant terms & boundaries6 sections · depth on demand

What this shows and what it does not

firewalld is confirmed when the original packet is mapped to the correct zone/policy and generated backend enforcement, runtime/permanent intent is coherent, and application behavior matches the resulting verdict.

firewalld owns zones, services, rich rules, policies and runtime/permanent management. nftables/netfilter own backend enforcement; NetworkManager may influence zone bindings; services own application readiness.

In depth

firewalld: zones, services and runtime vs permanent

firewalld manages the firewall through zones, each with a trust level and a set of allowed services and ports. The firewall-cmd manual page describes the central distinction: runtime and permanent configuration are separate.

  • Without --permanent, a change applies now but is lost at reload.
  • With --permanent, it's saved, but applies only after --reload.
  • --runtime-to-permanent saves the current runtime state.
  • --reload replaces the runtime with the permanent configuration.

Predefined zones (firewalld documentation)

ZoneBehaviour
dropIncoming packets dropped without reply
blockIncoming connections rejected with ICMP prohibited
publicUntrusted networks; only selected services (a common default)
externalOutside interface with IPv4 masquerading, for routers
dmzPublicly reachable hosts with limited access inwards
work / home / internalMostly trusted networks
trustedEverything accepted

How traffic is assigned to a zone

BindingCommand
By source address (checked first)--add-source=10.99.0.0/24 --zone=internal
By interface--add-interface=eth1 --zone=dmz (via NetworkManager where present)
OtherwiseThe default zone (--get-default-zone)

Common commands (manual)

TaskCommand
Active zones and their bindingsfirewall-cmd --get-active-zones
Everything in a zonefirewall-cmd --zone=public --list-all
Allow a service--add-service=https
Allow a port--add-port=8443/tcp
Temporary opening--add-service=ssh --timeout=30m
Rich rule--add-rich-rule='rule family=ipv4 source address=10.30.0.0/24 service name=mysql accept'
Masquerade, port forwarding--add-masquerade, --add-forward-port=port=80:proto=tcp:toaddr=10.30.0.20
Emergency block--panic-on (runtime only)
Is it present?--query-service=https (exit 0 or 1)
host$ sudo firewall-cmd --get-active-zones
internal
  sources: 10.99.0.0/24
public
  interfaces: eth0
host$ sudo firewall-cmd --zone=public --add-service=https
host$ sudo firewall-cmd --runtime-to-permanent
host$ sudo firewall-cmd --permanent --zone=internal --add-service=ssh
host$ sudo firewall-cmd --permanent --zone=public --remove-service=ssh
host$ sudo firewall-cmd --reload
host$ sudo firewall-cmd --zone=public --list-all | grep -E "services|ports|rich"
  services: dhcpv6-client https
  ports:
  rich rules:
host$ sudo firewall-cmd --check-config

SSH only from the management network

The internal zone, bound to the management source network, allows SSH. The public zone on eth0 no longer does. Because source bindings are checked before interfaces, management hosts still reach SSH, while everyone else doesn't.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

firewalld is part of Firewall → firewalld. firewalld is a dynamic Linux firewall manager that expresses policy through zones, services, ports, rich rules, source/interface bindings and policies while maintaining runtime and permanent configuration, typically using nftables as its backend.

nftables, iptables compatibility layers, firewalld and UFW are policy/configuration interfaces that can program overlapping kernel rulesets.

Topic-specific state model. firewalld is a dynamic Linux firewall manager that expresses policy through zones, services, ports, rich rules, source/interface bindings and policies while maintaining runtime and permanent configuration, typically using nftables as its backend.

Interpretation rule. - firewalld running ≠ the intended interface/source is bound to the expected zone.

  • Permanent configuration ≠ current runtime configuration until reload/restart applies it.
  • Runtime success ≠ persistence across reload/reboot unless permanent state also matches.
  • Service enabled in a zone ≠ application listener or end-to-end path is healthy.

Specialized mechanics

firewalld manages firewall policy through zones, services, ports, rich rules and policies and typically programs nftables as its backend. It has separate runtime and permanent configuration: runtime is the currently enforced state, while permanent configuration is the persisted model used on reload/restart. Interfaces and source networks are associated with zones, so the same service definition can behave differently depending on which zone owns a packet path. Policies can govern traffic between zones, so an ingress-zone service allowance alone may not explain forwarded or inter-zone flows.

Quick reference

firewalld uses zones (trust levels) bound to interfaces or source networks, with services, ports and rich rules.

firewall-cmd --get-active-zones
firewall-cmd --zone=public --list-all
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --zone=internal --add-source=10.0.0.0/8
firewall-cmd --permanent --zone=internal --add-service=ssh
firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=203.0.113.0/24 port port=8443 protocol=tcp accept'
firewall-cmd --reload
firewall-cmd --runtime-to-permanent

Runtime changes are lost on reload unless --permanent was used (or --runtime-to-permanent). A packet matches the zone of its source address first, then the zone of its interface.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. firewalld is confirmed when the original packet is mapped to the correct zone/policy and generated backend enforcement, runtime/permanent intent is coherent, and application behavior matches the resulting verdict.

ReferenceConfiguration & state2 sections · depth on demand

Configuration, persistence and lifecycle

Configuration intent and lifecycle. Choose one authoritative policy manager and understand generated rules before mixing direct nft/iptables edits with firewalld/UFW.

Distribution/platform context. firewalld owns zones, services, rich rules, policies and runtime/permanent management. nftables/netfilter own backend enforcement; NetworkManager may influence zone bindings; services own application readiness.

Specialized lifecycle

Choose the correct zone/policy and make changes in runtime, permanent or both according to intent. A permanent-only change is not active until reload, and reload can discard runtime-only exceptions. Prefer named services when they accurately represent ports/protocols; use rich rules/policies for explicit direction or source/destination constraints. Avoid editing backend nftables chains that firewalld owns because regeneration can replace them. Remote changes should preserve management access and a rollback path.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Firewall → firewalld. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://wiki.nftables.org/wiki-nftables/index.php/Main_Page · confidence 94%
2026-09-13 · vendor docfirewalld current

Authoritative Linux project/vendor documentation reviewed for bounded reference claims: zones, services, policies, runtime/permanent configuration and nftables backend. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.

Basis: https://firewalld.org/documentation/ · confidence 93%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
firewalldfirewall-cmdlinux firewall zonesfirewalld runtime permanent
Embedded reference data

Quick lookup tables

firewalld operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for firewalld.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective statefirewalld is a dynamic Linux firewall manager that expresses policy through zones, services, ports, rich rules, source/interface bindings and policies while maintaining runtime and permanent configuration, typically using nftables as its backend.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact namespace + five-tuple + interfaces/direction → prove route/listener prerequisites → identify manager/backend → snapshot full ruleset + hook priorities/default policies → reproduce with counters/trace + packet capture → correlate conntrack/NAT → change one demonstrated cause → read back effective state → repeat original workload + negative regression flow.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainfirewalld config → runtime/permanent zone/policy state → interface/source selection → generated nft backend rules → netfilter verdict/NAT → socket/egress → workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundaryfirewalld is proven when the original packet is mapped to the correct zone/policy and generated backend enforcement, runtime/permanent intent is coherent, and application behavior matches the resulting verdict.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux firewall evidence can establish this proof path: firewalld config → runtime/permanent zone/policy state → interface/source selection → generated nft backend rules → netfilter verdict/NAT → socket/egress → workloadUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured namespace, family, five-tuple, interface/direction, manager/backend, ruleset generation, conntrack/NAT state, time window or application scope. firewalld is proven when the original packet is mapped to the correct zone/policy and generated backend enforcement, runtime/permanent intent is coherent, and application behavior matches the resulting verdict.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven firewall boundary: preserve the current ruleset/state, capture the exact packet path and rule verdict, change only the demonstrated cause through the authoritative manager, read back effective policy, then repeat the original workload and regression flows.Continue to the next unresolved boundary while preserving the original test condition.

firewalld · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryfirewalld
Topic pathFirewall → firewalld
Runtime statefirewalld is a dynamic Linux firewall manager that expresses policy through zones, services, ports, rich rules, source/interface bindings and policies while maintaining runtime and permanent configuration, typically using nftables as its backend.
Fast checks- Read active zones, interface/source bindings, default zone and all settings for the zones/policies involved in the original flow. - Compare runtime and permanent views; expand service definitions, ports, protocols, rich rules and forwarding/policy objects. - Correlate backend nftables rules/counters and packet capture if zone/policy output is ambiguous or another manager is suspected. - Apply the smallest runtime/permanent change intentionally, verify both views after reload where needed, then repeat the original and negative regression flows.
Verification chainfirewalld config → runtime/permanent zone/policy state → interface/source selection → generated nft backend rules → netfilter verdict/NAT → socket/egress → workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryfirewalld is proven when the original packet is mapped to the correct zone/policy and generated backend enforcement, runtime/permanent intent is coherent, and application behavior matches the resulting verdict.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.

firewalld · specialized operational reference

Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.

Operational boundaryTopic-specific reference
State planesRuntime enforced vs permanent persisted
ClassificationInterface/source → zone; policies can span zones
BackendUsually nftables; firewalld owns generated rules
ProofCorrect zone + runtime rule + successful controlled flow
Confirmation

Confirm action

Continue?