↑ ↓ select, Enter open, Esc close

List ufw rules with numbers

root@server
ufw status numbered

Lists all rules of the ufw firewall with a number in square brackets, split into target, action and source. IPv6 rules appear as separate entries marked (v6). The numbers are needed for ufw delete <nummer> and ufw insert <nummer>.

Note: If it only shows Status: inactive, ufw is installed but not filtering anything.

Also searched as

  • ufw status numbered
  • list ufw rules
  • show firewall rules ubuntu

Related one-liners

All in Firewall

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.