- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
- Security

Configuring a Host Firewall on Ubuntu using UFW
In this lab, we will install and configure a firewall on an Ubuntu host using UFW. We will create the firewall rules to permit only VNC, HTTP, and SSH traffic inbound to the host and permit all outbound traffic from the host.

Lab Info
Table of Contents
-
Challenge
Install UFW.
Run the commands
sudo apt-get update
andsudo apt-get install -y ufw
. -
Challenge
Configure the default rules to deny all inbound and permit all outbound.
Run the following commands:
sudo ufw default deny incoming
sudo ufw default allow outgoing
-
Challenge
Configure UFW to permit only VNC, HTTP, and SSH traffic to the Ubuntu host.
Run the following commands:
sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 5900:5901/tcp
-
Challenge
Enable UFW.
Run the command
sudo ufw enable
. -
Challenge
Install the Lighttpd web server.
Run the following command:
sudo apt-get install -y lighttpd
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.