How to Install and Setup FireWall on Amazon Linux 2
- Mohammad Abu Mattar
- Cloud Computing
- 24 Oct, 2022
- 02 Mins read
Introduction
We will learn how to install and setup FireWall on Amazon Linux 2 in this tutorial. We will also discover how to set up FireWall so that it functions with the Amazon Linux 2.
Prerequisites
To follow along with this tutorial, you will need:
- An Amazon Linux 2 EC2 instance with a public IP address.
- A user with sudo privileges.
Install and Setup Firewalld on Amazon Linux 2
Step 1: Install Firewalld
Before we can install FireWall, we must first update the system.
Now that the system has been updated, we can install FireWall.
Next, after installing FireWall, it’s time to verify whether the iptables service is running.
If the iptables service is running, we need to stop it.
Now that the iptables service is stopped, we can start the FireWall service.
To verify that the FireWall service is running, we can use the following command.
Newly installed FireWall services are not enabled by default. To enable the FireWall service, we can use the following command.
Step 2: Configure Firewalld
Now that the FireWall service is running, we can configure it. To configure the FireWall service, we can use the following command.
List Firewalld Zones
List Services Default Zone
To verify that the FireWall service is configured correctly, we can use the following command.
List All Firewalld Zones
Step 3: Set Up Default Firewalld Zone
To set up the default Firewalld zone, we can use the following command.
Step 4: Check FireWall Status
To check the FireWall status, we can use the following command.
Step 5: Assigning Services to Firewalld Zones
To assign services to Firewalld zones, we can use the following command.
Step 6: Adding Services to Firewalld Zones
To add services to Firewalld zones, we can use the following command.
Conclusion
In this tutorial, we learned how to install and setup FireWall on Amazon Linux 2. We also learned how to set up FireWall so that it functions with the Amazon Linux 2.