RHEL 10 FirewallD Commands & Examples

Discover how to use FirewallD in RHEL 10 with practical commands and real-world examples. This detailed guide explains zone management, service rules, rich rules, port handling, and security best practices to help you harden your Red Hat Enterprise Linux 10 environment. Whether you are a beginner or an experienced sysadmin, learn how to configure, monitor, and troubleshoot FirewallD effectively while aligning with enterprise security standards.

Aug 28, 2025 - 12:53
Sep 2, 2025 - 10:29
 0  3
RHEL 10 FirewallD Commands & Examples

What is FirewallD in RHEL 10?

In RHEL 10, FirewallD is the default firewall management service that provides dynamic firewall capabilities for Linux servers. Unlike static rules applied via traditional iptables, FirewallD enables administrators to manage firewall rules without restarting the firewall service, ensuring uninterrupted connectivity for production workloads. This flexibility is essential for enterprises that demand continuous uptime and quick adaptability to evolving security requirements.

At its core, FirewallD is built on the concept of zones and services. Zones define trust levels for network connections, while services provide pre-defined sets of rules for commonly used protocols like HTTP, HTTPS, SSH, and DNS. With RHEL 10, FirewallD introduces improved support for IPv6, stronger default profiles, and integration with modern DevOps workflows, making it a cornerstone of system hardening and network security in enterprise Linux environments.

How Has Firewall Management Evolved in RHEL?

The evolution of firewall management in Red Hat Enterprise Linux reflects the broader transformation in enterprise IT security. Earlier versions relied heavily on iptables, a powerful but complex tool that required intricate rule management. While effective, iptables configurations were often static and difficult for administrators to modify in real time without disrupting services.

With the introduction of FirewallD in RHEL 7, Red Hat aimed to simplify firewall administration by providing an abstraction layer that manages iptables rules dynamically. By RHEL 8 and RHEL 9, FirewallD had matured, adding features like runtime and permanent configurations, integration with systemd, and support for cloud-native workloads. Now, in RHEL 10, FirewallD builds upon this foundation by offering enhanced automation, compatibility with containerized environments, and streamlined security for hybrid cloud infrastructures.

Core Principles of FirewallD

FirewallD in RHEL 10 operates on three fundamental principles:

1. Zone-Based Security

Zones represent levels of trust associated with network interfaces. For example, the public zone restricts most traffic except for explicitly allowed services, while the trusted zone permits all communication. Administrators can assign different interfaces to zones based on security requirements, offering flexibility across development, testing, and production environments.

2. Dynamic Rule Management

Unlike static rule sets, FirewallD allows administrators to modify rules on the fly. This eliminates downtime caused by service restarts, which is crucial in high-availability environments where even a minute of disruption can result in revenue loss or security exposure.

3. Service-Centric Approach

Instead of writing complex rules for every port and protocol, FirewallD provides predefined services. For example, enabling SSH access is as simple as running a single command. This not only reduces administrative overhead but also minimizes misconfigurations that could expose the system to attacks.

Key FirewallD Practices for RHEL 10

To secure RHEL 10 systems effectively, administrators must adopt best practices that align with enterprise-grade security standards. Below are some key practices:

1. Define Appropriate Zones

Assigning interfaces to correct zones is fundamental. Public-facing servers should use restrictive zones, while internal systems may leverage more permissive ones. Each zone can be customized to balance security with functionality.

2. Use Runtime and Permanent Rules

FirewallD distinguishes between runtime (temporary) and permanent configurations. Always test changes in runtime mode before committing them to permanent rules. This minimizes the risk of accidentally locking yourself out of the system.

3. Enable Logging

Enable firewall logging to monitor denied packets. This provides valuable insights into potential intrusion attempts and allows for fine-tuning of firewall rules.

4. Harden SSH Access

Restrict SSH to specific IP addresses, use non-standard ports where applicable, and leverage key-based authentication. Combine these with FirewallD service restrictions to build multiple layers of defense.

Essential FirewallD Commands with Examples

FirewallD provides a powerful yet simple command-line interface through the firewall-cmd tool. Below are some essential commands:

Check FirewallD Status

systemctl status firewalld

Displays whether FirewallD is active and running on your RHEL 10 system.

Start and Enable FirewallD

systemctl start firewalld
systemctl enable firewalld

Ensures the firewall starts automatically on system boot.

View Active Zones

firewall-cmd --get-active-zones

Shows which zones are currently in use and the interfaces assigned to them.

Allow a Service (Example: HTTP)

firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload

This opens port 80 (HTTP) for public access permanently.

Block a Port

firewall-cmd --zone=public --remove-port=8080/tcp --permanent
firewall-cmd --reload

Closes access to port 8080 in the public zone.

Enable Logging of Denied Packets

firewall-cmd --set-log-denied=all

Logs all denied connection attempts for monitoring and auditing purposes.

FirewallD vs iptables: Tool Comparison Table

Feature FirewallD (RHEL 10) iptables
Configuration Type Dynamic, runtime & permanent modes Static, requires service restart
User Friendliness Service and zone-based Complex rule-based syntax
IPv6 Support Native, improved in RHEL 10 Limited
Integration Systemd, cloud-native workloads Manual scripts
Logging Built-in with granular options Requires extra configuration

Benefits of Using FirewallD in RHEL 10

FirewallD provides numerous advantages over legacy solutions, including:

  • Dynamic rule updates without downtime.
  • Zone-based approach that simplifies network segmentation.
  • Predefined services that reduce misconfiguration risks.
  • Strong integration with container and virtualization platforms.
  • Improved IPv6 handling for modern enterprise environments.

Challenges in Managing FirewallD

Despite its strengths, FirewallD is not without challenges:

  • Learning curve for administrators transitioning from iptables.
  • Complexity in managing custom services for niche protocols.
  • Risk of misconfigured runtime rules if not carefully tested.
  • Integration issues in hybrid environments with legacy applications.

The Future of FirewallD in Enterprise Linux

Looking forward, FirewallD is expected to integrate more tightly with automation frameworks such as Ansible and Terraform, enabling infrastructure-as-code approaches to firewall management. With enterprises moving toward zero-trust architectures, FirewallD’s zone and service model aligns well with fine-grained security requirements. In RHEL 10 and beyond, we can expect continued enhancements in usability, performance, and compatibility with containerized workloads in Kubernetes and OpenShift environments.

Conclusion

FirewallD in RHEL 10 is more than just a firewall—it is a modern, dynamic, and enterprise-ready security management solution. By leveraging its zones, services, and runtime flexibility, administrators can build resilient and secure environments that scale across hybrid and cloud-native infrastructures. While challenges exist in terms of complexity and adaptation, the benefits far outweigh the learning curve. For organizations adopting RHEL 10, mastering FirewallD is an essential step toward building a proactive and robust security posture.

Frequently Asked Questions

What is FirewallD used for in RHEL 10?

FirewallD is the default firewall service in RHEL 10, designed to manage and control network traffic dynamically using zones and services. It provides real-time rule updates without restarting, which ensures continuous uptime for production environments. Its service-based configuration makes it simpler than iptables while offering advanced features like IPv6 support and integration with systemd.

How is FirewallD different from iptables?

FirewallD abstracts the complexity of iptables by introducing zones and predefined services. Unlike iptables, which uses static configurations, FirewallD enables administrators to apply runtime and permanent rules without downtime. This makes FirewallD more flexible and easier to manage, especially in enterprise and cloud-native deployments.

How do I check if FirewallD is running on RHEL 10?

You can check FirewallD’s status using the command systemctl status firewalld. If active, the output will show FirewallD running as a system service. You can also verify active zones using firewall-cmd --get-active-zones.

Can I still use iptables on RHEL 10?

Yes, iptables is still available on RHEL 10 for backward compatibility, but FirewallD is recommended. FirewallD manages iptables and nftables under the hood, making it the preferred method due to its abstraction and dynamic configuration features.

What are FirewallD zones?

Zones in FirewallD define trust levels for network connections. For example, the public zone blocks most traffic except explicitly allowed services, while the trusted zone allows all communication. This zoning system helps segment and secure different types of network traffic based on security requirements.

How do I allow a service with FirewallD?

To allow a service, use the command firewall-cmd --zone=public --add-service=http --permanent followed by firewall-cmd --reload. This permanently enables HTTP traffic in the public zone without downtime.

How do I block a specific port in FirewallD?

You can block a port by removing it from the zone configuration. For example: firewall-cmd --zone=public --remove-port=8080/tcp --permanent. After reloading FirewallD, port 8080 will no longer accept connections.

Does FirewallD support IPv6 in RHEL 10?

Yes, FirewallD in RHEL 10 has improved IPv6 support. Administrators can configure both IPv4 and IPv6 rules seamlessly, making it well-suited for modern enterprise environments where dual-stack networking is common.

What is the difference between runtime and permanent rules?

Runtime rules are temporary and apply until the next reboot or reload, while permanent rules persist across reboots. Administrators typically test rules in runtime mode before committing them permanently to ensure they don’t accidentally disrupt services.

How can I enable firewall logging in RHEL 10?

You can enable logging by running firewall-cmd --set-log-denied=all. This logs all denied packets, helping administrators monitor suspicious activity and fine-tune firewall policies for better security.

Is FirewallD suitable for cloud environments?

Yes, FirewallD integrates well with cloud-native platforms and supports dynamic workloads. It is especially effective in containerized environments like Kubernetes and OpenShift, where services and ports change frequently.

Can I manage FirewallD through a GUI?

Yes, FirewallD can be managed using graphical tools such as firewall-config. This GUI provides a user-friendly interface for configuring zones, services, and ports, making it easier for administrators less comfortable with command-line management.

Does FirewallD support automation tools?

Yes, FirewallD integrates with automation frameworks like Ansible, Puppet, and Terraform. This allows enterprises to adopt infrastructure-as-code approaches, ensuring consistency across multiple RHEL 10 systems.

Can FirewallD coexist with SELinux?

Absolutely. FirewallD and SELinux complement each other. While FirewallD controls network traffic, SELinux enforces access controls at the application and process level, providing a layered security model that reduces attack surfaces.

How does FirewallD improve system uptime?

Because FirewallD applies rule changes dynamically, there is no need to restart the firewall service. This eliminates downtime during configuration changes, which is critical for enterprise systems running 24/7 workloads.

What happens if I misconfigure FirewallD?

If a misconfiguration occurs, especially with runtime rules, you can reload or revert settings. This flexibility reduces the risk of permanently locking yourself out of the system, which was a common issue with iptables.

Can I create custom services in FirewallD?

Yes, administrators can define custom XML-based service files in FirewallD. This allows support for proprietary applications and niche protocols that are not part of the default service list.

Is FirewallD resource-intensive?

No, FirewallD is lightweight and optimized for enterprise systems. It adds minimal overhead while providing dynamic security controls, ensuring it does not impact server performance.

What role does FirewallD play in zero-trust security?

FirewallD’s zone-based model aligns well with zero-trust security, where no connection is trusted by default. By segmenting traffic and enforcing strict service-based rules, it supports fine-grained security policies.

Should I disable FirewallD if I use external firewalls?

It is not recommended to disable FirewallD. Even with external firewalls, FirewallD provides host-level protection, ensuring that misconfigurations or bypass attempts at the network perimeter do not compromise the server itself.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.