$
Learn Linux handbook
en
XP:0
Quest 34Defender
+200 XP

Linux Firewalls (ufw & iptables)

Launch Interactive Terminal for This Quest→No installation required • Runs fully in browser

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.

Let's inspect our security guards. View the status of the uncomplicated firewall by running sudo ufw status, and then check the lower-level Netfilter rules by running sudo iptables -L.

Command Syntax Reference

Command / SyntaxDescription
sudo ufw statusDisplay ufw firewall rules
sudo iptables -LList 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.