I can get a non verbose ufw output with numbers (convenient to edit / delete rules based on their number):
pi@raspberrypi:~ $ sudo ufw status numbered verbose
Status: active
To Action From
-- ------ ----
[ 1] 22/tcp ALLOW IN Anywhere
[ 2] 22/tcp (v6) ALLOW IN Anywhere (v6)
but I cannot get a verbose (to also display the defaults) output numbered:
pi@raspberrypi:~ $ sudo ufw status verbose numbered
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (v6)
Any idea how to get the ufw verbose output, with numbers on the rules (so that I can edit / delete them etc, while being aware of the defaults at the same time?)?
afaik there is no built-in way to display both. But you can just pipe your verbose output to awk to get both, like:
Result: