0Pricing
Cyber Security Academy · Lesson

iptables and UFW Firewall Rules

Write firewall rules to allow, deny, and log traffic using iptables and the simpler UFW interface.

Linux Firewalls Overview

Linux filters network traffic via the netfilter kernel framework. iptables is the traditional userspace tool; nftables is its modern replacement. UFW (Uncomplicated Firewall) is a simplified frontend for iptables, ideal for Ubuntu/Debian servers.

iptables Chains

iptables uses chains to process packets:

  • INPUT — packets destined for the local machine
  • OUTPUT — packets originating from the local machine
  • FORWARD — packets being routed through the machine

Rules in each chain are evaluated top-to-bottom; first match wins.

All lessons in this course

  1. File Permissions and Ownership
  2. User and Group Management
  3. SSH Hardening and Key-Based Auth
  4. iptables and UFW Firewall Rules
← Back to Cyber Security Academy