How to Set Up FirewallD on CentOS
Introduction
FirewallD is a dynamic firewall manager for Linux systems, providing a flexible way to manage firewall rules. This guide shows you how to install and configure FirewallD on CentOS.
Step-by-step Guide
- Update your package list
- sudo yum update
- Install FirewallD
- sudo yum install -y firewalld
- Start and enable FirewallD
- sudo systemctl start firewalld
- sudo systemctl enable firewalld
- Check FirewallD status
- sudo systemctl status firewalld
- Allow a service or port (example: HTTP)
- sudo firewall-cmd --permanent --add-service=http
- sudo firewall-cmd --permanent --add-port=8080/tcp
- sudo firewall-cmd --reload
- List all active rules
- sudo firewall-cmd --list-all
Recommendations
- Only open the ports you need for your applications.
- Regularly review and update your firewall rules.
- Combine FirewallD with fail2ban for enhanced security.
Call To Action
eed a secure VPS for your projects? Check out our hosting plans: https://xernode.com/#pricing
Related Guides
- How to Enable Firewall (UFW) in Ubuntu
- How to Secure Your VPS with Fail2Ban
- How to Set Up a Monitoring Alert with email