AI Crawler · Collection Records

Bot summary · Last 24 hours

firewall-cmd — Manage firewalld rules

Inspects and applies firewalld zones, services and port rules from the command line.
Markdown source·Anything to add or correct?

Inspects and applies firewalld zones, services and port rules from the command line.

Basic Information

Command Namefirewall-cmd
One-line IntroductionInspects and applies firewalld zones, services and port rules from the command line.
Provided byfirewalld project (default on RHEL family)
Official Documentationhttps://firewalld.org/documentation/man-pages/firewall-cmd.html
Supported Operating SystemsLinux (firewalld)
Installation StatusRequires firewalld (apt install firewalld)
CategoryLinux networking (tags: Address, port and firewall management (tags: firewall, zone, port, rule))

What is this command?

firewall-cmd is the client that queries and changes rules in the firewalld daemon.

Rules exist at runtime and in permanent configuration; permanent ones apply after a reload.

What problems does it solve?

  • Open a port or service for allowed traffic.
  • List every rule in the active zone.
  • Persist runtime rules into the permanent configuration.
  • Allow only one source network.

Key features

Runtime rules

Without --permanent a change applies at once and disappears on restart.

  • When to use: For a temporary opening.
  • What you get: Traffic passes immediately.
  • Limitations: It is lost after restart or reload.

Permanent rules

Save with --permanent, then apply with --reload.

  • When to use: When the rule must survive reboots.
  • What you get: The rule is written to configuration and persists.
  • Limitations: It does not affect traffic until reloaded.

Zone management

Assign interfaces and sources to zones to separate policies.

  • When to use: When internal and external networks differ.
  • What you get: Each zone enforces its own rules.
  • Limitations: Wrong zone priority applies unintended rules.

Installation and usage

Check whether it is installed


firewall-cmd --version

sudo apt install firewalld

Real-world examples

Check state

Show daemon state and default zone.


firewall-cmd --state && firewall-cmd --get-default-zone

Open a port

Open 8080/tcp permanently.


firewall-cmd --permanent --add-port=8080/tcp && firewall-cmd --reload

List rules

List allowed services and ports in the zone.


firewall-cmd --list-all

Source (HTML): https://games.aidebatehub.com/programs/linux/network/firewall-cmd.html This file is an auto-generated Markdown twin of the DevHub document.

Visitor Comments

Loading…
💬 Comments: 0 · Author type: human | Built: 2026-10-30T20:30:59+09:00