How to Install and Enable firewalld on AlmaLinux
Categories:
2 minute read
Introduction (30 seconds)
Hello everyone. Welcome to my channel! Today, I will show you how to install and enable firewalld in AlmaLinux.
Let’s get started!
First things first — it’s always a good idea to make sure your system is up to date. Open your terminal and type:
sudo dnf update -y
This will fetch and install the latest security patches and software updates.
Check if firewalld is already installed (10 seconds)
Before we dive into the installation, let’s check if firewalld is already installed on your system.
Run the this command:
sudo dnf list installed firewalld
If it’s installed, you’ll see it listed. If not, don’t worry; we’ll install it in the next step
Installation Steps (1 minute)
Just run this command:
sudo dnf install firewalld -y
This will download and install the firewall service and its dependencies.
Enable and Start firewalld (1 minute)
After installation, we need to enable and start the service:
sudo systemctl enable firewalld
The first command ensures that firewalld starts automatically at boot, and the second one starts it right now.
Check Status (30 seconds)
Now, let’s check if firewalld is running properly. You can do this by running:
sudo systemctl status firewalld
This command will show you the current status of the firewalld service. If it’s active and running, you’re all set!
Basic Configuration (1 minute)
Now let’s check the default zone and the services that are allowed through the firewall. You can check the default zone by running:
sudo firewall-cmd --list-all
The default zone is usually public, and it will show you the services that are allowed through the firewall and the ports that are open.
public (active)
target: default
icmp-block-inversion: no
interfaces: enp0s3
sources:
services: cockpit dhcpv6-client ssh
ports:
protocols:
forward: yes
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
You can also allow specific services, like:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
That’s it for now! You’ve successfully installed and configured firewalld on your AlmaLinux system.
Conclusion (30 seconds)
If you found this tutorial helpful, please like and subscribe for more Linux administration videos. Drop any questions in the comments below!
Thanks for watching.
Optional Thumbnail Text Ideas
- “Secure Your AlmaLinux Server!”
- “Firewalld Made Easy!”
- “Step-by-Step: firewalld Installation”
- “Protect Your Server with firewalld”
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.