What does ufw do?

Uncomplicated Firewall — a friendly front-end for the iptables firewall.

▸ Explain your own ufw command →

ufw examples, explained

$ ufw allow 22/tcp

  • ufwUncomplicated Firewall — a friendly front-end for the iptables firewall
  • allowadd a rule permitting traffic
  • 22/tcpan argument passed to the command

$ ufw enable

  • ufwUncomplicated Firewall — a friendly front-end for the iptables firewall
  • enableturn the firewall on (and at boot)

$ ufw status verbose

  • ufwUncomplicated Firewall — a friendly front-end for the iptables firewall
  • statusshow the firewall state and active rules
  • verbosean argument passed to the command

ufw subcommands

enable — turn the firewall on (and at boot)disable — turn the firewall offallow — add a rule permitting trafficdeny — add a rule silently dropping trafficreject — add a rule rejecting traffic (sends an error back)delete — remove a previously added rulestatus — show the firewall state and active rulesreload — reload the firewall rulesreset — disable and reset to factory defaultsdefault — set the default policy for incoming/outgoing trafficlimit — allow but rate-limit connections (brute-force protection)logging — set the logging level

ufw flags & options

--dry-runshow the resulting rule set without applying it
--forceapply without the interactive confirmation prompt

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.