← Volver al blog

How to Set Up FirewallD on CentOS

  • Xernode
  • 1 min de lectura
  • 11 de abril de 2026
Centos firewall security linux vps firewalld 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

  1. Update your package list
    • sudo yum update
  2. Install FirewallD
    • sudo yum install -y firewalld
  3. Start and enable FirewallD
    • sudo systemctl start firewalld
    • sudo systemctl enable firewalld
  4. Check FirewallD status
    • sudo systemctl status firewalld
  5. 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
  6. 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