How to Enable Firewall on AlmaLinux Print

  • 0

. How to Enable Firewall on AlmaLinux

. Introduction

A firewall is a crucial security feature that monitors and controls incoming and outgoing network traffic based on predetermined security rules. AlmaLinux uses `firewalld` as its firewall management tool. This guide will show you how to enable and configure the firewall on AlmaLinux.

. Prerequisites

- Root or sudo access to the AlmaLinux system.

.# Steps

1. **Install firewalld**:
- If `firewalld` is not already installed, you can install it using the following command:
```sh
sudo dnf install firewalld
```

2. **Start and Enable firewalld**:
- Start the `firewalld` service:
```sh
sudo systemctl start firewalld
```
- Enable `firewalld` to start on boot:
```sh
sudo systemctl enable firewalld
```

3. **Check Status of firewalld**:
- Verify that the `firewalld` service is running:
```sh
sudo systemctl status firewalld
```

4. **Allow Specific Services and Ports**:
- Allow a specific service (e.g., HTTP) through the firewall:
```sh
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
```
- Allow a specific port (e.g., port 8080):
```sh
sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reload
```

5. **Check Firewall Rules**:
- List all active zones and their services:
```sh
sudo firewall-cmd --get-active-zones
```
- List all allowed services and ports:
```sh
sudo firewall-cmd --list-all
```

6. **Manage Zones**:
- To add an interface to a specific zone:
```sh
sudo firewall-cmd --zone=public --add-interface=eth0 --permanent
sudo firewall-cmd --reload
```

. Conclusion

Enabling and configuring the firewall on AlmaLinux using `firewalld` helps enhance the security of your system by controlling network traffic effectively. By following these steps, you can manage and customize firewall rules to suit your needs.

**Wpressly.com: Offering the best web hosting services and VPS servers with exceptional performance and 24/7 technical support.**


Was this answer helpful?

Back