๐Ÿงฑ UFW / iptables โ€” firewall basics

Hackbydoing Academy cheat sheet ยท ufw ยท iptables ยท firewall ยท defense

UFW (the friendly front-end)

ufw status verboseRules + default policy โ€” read this first
ufw deny from <ip>Block one address completely โ€” the incident-response classic
ufw allow 22/tcpAllow SSH (do this BEFORE enabling, or lock yourself out)
ufw enable / disableTurn the firewall on/off
ufw delete deny from <ip>Remove a rule
Default posturedeny incoming, allow outgoing โ€” then open only what you serve

iptables (what's underneath)

iptables -L -nList rules without DNS lookups
iptables -A INPUT -s <ip> -j DROPDrop one source address
Order mattersFirst matching rule wins โ€” a broad ALLOW above your DROP silently wins
Defender's noteA firewall is a policy, not a talisman: it only stops what its rules describe

Free from the Hackbydoing Academy โ€” the game that teaches real cybersecurity, attack and defense, on simulated networks. Play free at hackbydoing.com ยท Print this page (Ctrl/Cmd+P) for a clean paper copy.