cmdxray / commands / firewall-cmd

What does firewall-cmd do?

manage firewalld — the dynamic firewall daemon on RHEL/Fedora systems.

▸ Explain your own firewall-cmd command →

firewall-cmd examples, explained

$ firewall-cmd --zone=public --add-port=80/tcp --permanent

  • firewall-cmdmanage firewalld — the dynamic firewall daemon on RHEL/Fedora systems
  • --zone=publicoperate on the given zone
  • --add-port=80/tcpopen a port (e.g. 80/tcp) in the zone
  • --permanentmake the change persist across reloads/reboots

$ firewall-cmd --reload

  • firewall-cmdmanage firewalld — the dynamic firewall daemon on RHEL/Fedora systems
  • --reloadreload rules from the permanent configuration

$ firewall-cmd --list-all

  • firewall-cmdmanage firewalld — the dynamic firewall daemon on RHEL/Fedora systems
  • --list-allshow every setting for the zone

firewall-cmd flags & options

--zoneoperate on the given zone
--add-portopen a port (e.g. 80/tcp) in the zone
--remove-portclose a previously opened port
--add-serviceallow a named service (e.g. http, ssh)
--remove-servicedisallow a named service
--add-rich-ruleadd a fine-grained 'rich' rule
--list-allshow every setting for the zone
--permanentmake the change persist across reloads/reboots
--reloadreload rules from the permanent configuration
--statereport whether firewalld is running
--get-zoneslist the available zones
--get-active-zoneslist zones that have interfaces bound to them

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.