Linux Firewalls (ufw & iptables)
Concept & Overview
Imagine living in a secure apartment building where a security guard stands at the entrance checking IDs and blocking unauthorized visitors. In Linux, a firewall acts as this security guard for your network ports.
- The ufw (Uncomplicated Firewall) command is a user-friendly interface for managing firewall rules. Running sudo ufw status displays whether the firewall is active and which ports (like port 22 for SSH or port 80 for web servers) are open.
- The iptables command is the low-level, traditional Netfilter tool that actually blocks or redirects packets. Running sudo iptables -L lists the active security chains and packet-matching rules.
sudo ufw status, and then check the lower-level Netfilter rules by running sudo iptables -L.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
sudo ufw status | Display ufw firewall rules |
sudo iptables -L | List active iptables packet filtering rules |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Run the "ufw status" command with sudo
- ○Run the "iptables -L" command with sudo
Ready to complete Quest 34?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.