firewalld
is a firewall management tool available on many Linux distributions, including Rocky Linux. It provides a dynamically managed firewall with support for network zones to define the level of trust for network connections or interfaces.
Setting up a firewall is crucial for ensuring the security and integrity of your system. In this guide, we’ll walk you through the process of setting up a firewall using firewalld
on Rocky Linux 9 and opening ports 5672 and 15672, which are commonly used by RabbitMQ.
If firewalld
is not already installed on your system, you can install it using the following command:
sudo dnf install firewalld
Once installed, start the firewalld
service and enable it to start on boot:
sudo systemctl start firewalldsudo systemctl enable firewalld
To ensure firewalld
is running, use the following command:
sudo systemctl status firewalld
RabbitMQ typically uses port 5672 for client connections and 15672 for the management plugin. To open these ports, use the following commands:
sudo firewall-cmd --zone=public --add-port=5672/tcp --permanentsudo firewall-cmd --zone=public --add-port=15672/tcp --permanent
After making changes, reload firewalld
to apply them:
sudo firewall-cmd --reload
To verify that the ports are open, use:
sudo firewall-cmd --list-all
This command will show all settings, including open ports in the current zone.
Your Rocky Linux 9 system now has a running firewalld
firewall with ports 5672 and 15672 open for RabbitMQ. This setup enhances your system’s security while allowing necessary traffic for RabbitMQ.
Remember, firewall management is a critical aspect of system administration. Regularly check and update your firewall settings to ensure optimal security.
We’d love to hear your feedback on this tutorial! If you have any questions or suggestions for improvement, please don’t hesitate to reach out. You can leave a comment below, or you can contact us through the following channels:
If you found this guide beneficial, don’t hesitate to share it with your network. Until the next guide, happy coding!
Quick Links
Legal Stuff