OnCallReadyStart learning

iptables: administration tool for IPv4 packet filtering and NAT (nf_tables backend)

iptables [-t table] -L [chain] [-n] [--line-numbers] | iptables [-t table] -S [chain]

Options you will use

-t, --table TABLE
filter (default), nat, mangle, raw
-L, --list [CHAIN]
List all rules in the selected chain (all chains if none): target, prot, source, destination, matches
-S, --list-rules [CHAIN]
Print the rules as the commands that create them (-P policies, -N chains, -A rules)
-n, --numeric
Numeric output: addresses and ports as numbers (no /etc/services names)
--line-numbers
Number the rules of each chain (the position -I / -D take)

Examples

$ sudo iptables -S INPUT

the INPUT chain in order: Calico, kube-proxy, then ufw

$ sudo iptables -L ufw-user-input -n

the rules ufw made from your commands

Try iptables in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.