firewalld is a dynamic firewall management tool that provides a D-Bus interface for managing firewall rules. Default on RHEL, CentOS, and Fedora, it supports network zones for different trust levels and allows runtime changes without restarting the firewall service.
Key Features
- Zone-Based – Define trust levels for network connections
- Runtime Changes – Apply rules without restart
- D-Bus Interface – Integration with system services
- Rich Rules – Complex firewall configurations
- Service Definitions – Pre-configured service rules
Basic Usage
# Check status
sudo firewall-cmd --state
# List all zones
sudo firewall-cmd --get-zones
# Get active zones
sudo firewall-cmd --get-active-zones
# Add service permanently
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
# Add port
sudo firewall-cmd --permanent --add-port=8080/tcp
# Reload firewall
sudo firewall-cmd --reload
# List all rules
sudo firewall-cmd --list-all
Was this article helpful?