0
0
Linux CLIscripting~5 mins

Firewall basics (ufw, iptables) in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the primary purpose of a firewall in Linux?
A firewall controls incoming and outgoing network traffic to protect the system from unauthorized access and attacks.
Click to reveal answer
beginner
What does ufw stand for and what is it used for?
ufw stands for Uncomplicated Firewall. It is a user-friendly tool to manage firewall rules on Linux systems.
Click to reveal answer
beginner
How do you enable the firewall using ufw?
You enable the firewall by running the command: sudo ufw enable. This activates the firewall with the current rules.
Click to reveal answer
intermediate
What is iptables used for in Linux?
iptables is a powerful command-line tool to configure the Linux kernel firewall, allowing detailed control over network traffic.
Click to reveal answer
intermediate
How would you list all current iptables rules?
Use the command sudo iptables -L -v to list all current firewall rules with details.
Click to reveal answer
Which command enables the firewall using ufw?
Asudo ufw enable
Bsudo ufw start
Csudo iptables enable
Dsudo firewall start
What does the command sudo iptables -L do?
ALists all current firewall rules
BDeletes all firewall rules
CEnables the firewall
DDisables the firewall
Which tool is simpler for beginners to manage firewall rules?
Aiptables
Btcpdump
Cnetstat
Dufw
What is the default policy of ufw if not changed?
AAllow all outgoing traffic
BAllow all incoming traffic
CDeny all incoming traffic
DDeny all outgoing traffic
Which command adds a rule to allow SSH traffic using ufw?
Asudo iptables allow ssh
Bsudo ufw allow 22
Csudo ufw block 22
Dsudo iptables add ssh
Explain how to enable and check the status of the firewall using ufw.
Think about commands to turn on ufw and how to see if it is active.
You got /3 concepts.
    Describe the difference between ufw and iptables in managing Linux firewalls.
    Consider which tool is simpler and which is more powerful.
    You got /3 concepts.