Concept Flow - Firewall basics (ufw, iptables)
Start: No rules
Add rule with ufw or iptables
Rule stored in firewall config
Firewall active: packets checked
Packet matches rule?
No→Block or default action
Yes
Allow or reject packet
End: Packet processed
The firewall starts with no rules, then rules are added using ufw or iptables. When active, each network packet is checked against these rules to decide if it is allowed or blocked.