LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ufw-show

Print a report from the running Uncomplicated Firewall

TLDR

Show rules in the form they were entered
$ sudo ufw show added
copy
Show listening ports and the rules that can match them
$ sudo ufw show listening
copy
Show the whole running firewall
$ sudo ufw show raw
copy
Show one slice of the ruleset
$ sudo ufw show [builtins|before-rules|user-rules|after-rules|logging-rules]
copy

SYNOPSIS

ufw [--dry-run] show REPORT

DESCRIPTION

ufw show prints one report about the firewall ufw has loaded. It is a subcommand of ufw, not a separate program.Every report except listening is a subset of the iptables rules, or the full set in the case of raw. listening inspects the live sockets and then lists rules that might apply to each port. The first matching rule wins.

PARAMETERS

raw

The complete firewall, in raw iptables format (filter, nat, mangle, and raw tables).
builtins
Built-in chains from the raw report.
before-rules
Rules that run before the user rules.
user-rules
The user rule chains.
after-rules
Rules that run after the user rules.
logging-rules
The logging chains.
listening
TCP ports in the listen state and UDP ports in the open state, with the interface address and the program bound to the port. An asterisk means the program is bound on every address. Matching rules follow, in kernel evaluation order. The default policy is not listed. tcp6 and udp6 appear only when IPv6 is enabled.
added
Rules as they were typed. This is not the live firewall state (use ufw status for that). ufw normalizes rules, so a line may not match what was typed, and IPv6-only rules are listed after the others.
--dry-run
Global ufw flag. A show report reads the running firewall, so a dry run does not change it.

INSTALL

sudo dnf install ufw
copy
sudo pacman -S ufw
copy
sudo apk add ufw
copy
sudo zypper install ufw
copy

CAVEATS

Reading these reports usually needs root. added can disagree with the command you remember, because ufw stores a normalized rule and does not keep the original command order.

HISTORY

Part of ufw (Uncomplicated Firewall), Ubuntu's frontend for iptables and nftables.

SEE ALSO

RESOURCES

Copied to clipboard
Kai