• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • PKI Training
  • OpenSSL
  • Keytool
  • PKI Tools
    • Apereo CAS
    • SAML
    • OpenID Connect
  • Get expert help

Firewall Redhat

January 8, 2025 by Mister PKI Leave a Comment

This article will demonstrate how to manage a firewall on a Redhat server. Firewall functions that will be covered include how to check the firewall status, start, stop, enable, and disable it. The examples below were performed on RHEL 8.x.

The default firewall on RHEL 8 is firewalld and is enabled by default. If your Redhat instance is on a local network protected by a perimeter firewall you may prefer to disable the local firewalld firewall. If the server is public you should strongly consider leaving the firewall enabled.

Redhat Firewall Status

The first step in managing the local Redhat firewall is to check its status. If it is a new instance, the status should be enabled by default. If you’re troubleshooting an issue on a server installed by a previous systems administrator, you should most definitely check the status first.

To check the RHEL firewall status, use the systemctl utility.

systemctl status firewalld

The output will show if the firewall is enabled. If it is enabled, it will automatically start after a reboot.

If the firewall is not running, you will see the following message.

* firewalld is not running

Redhat Firewall Rules

To display the rules configured in your firewall run the following command.

firewall-cmd --list-all

Redhat Enable Firewall

To enable the firewall, run the following command.

systemctl enable firewalld

Disable Firewall

To disable the firewall, run the following command.

systemctl disable firewalld

Start Firewall

To start the firewall, run the following command.

systemctl start firewalld

Stop Firewall

To stop the firewall, run the following command.

systemctl stop firewalld

firewalld allow service

In the event you need to allow a specific service through the firewall without knowing the ports involved you can use the –add-service option. In this example, the samba service is allowed through temporarily.

firewall-cmd --add-service=samba

To permanently allow the service through which will persist through a reboot, use the –permanent option.

firewall-cmd --add-service=samba --permanent

After allowing the samba service you can test with the smbclient on the command line.

smbclient //samba.example.com/testshare -U misterpki

You should no longer see this error message:

do_connect: Connection to samba.example.com failed (Error NT_STATUS_HOST_UNREACHABLE)

If you do then double check that you properly allowed the samba service through the firewall.

firewalld list services

To show the services allowed through firewalld run this command.

firewall-cmd --list-services

firewalld list ports

To show the ports allowed through firewalld run this command.

firewall-cmd --list-ports

Conclusion

This article has demonstrated how to run various functions within firewalld in Redhat. We hope you have learned how to start, stop, enable, disable, and check the firewall status. Let us know in the comments if you have any questions or would like to see additional examples of how to manage a firewall in Linux. If you liked this post, check our additional articles we have written.

linux,  redhat

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular Posts

PKCS12

openssl s_client

Keytool

Keytool list

ECDSA vs RSA

OpenSSL

PKCS7

Certificate Decoder

PKI for DevOps Engineers – Free Training Series

PKI for DevOps Training Hub

Lesson 1 – How TLS and PKI Work

Lesson 2 – Understanding X.509 Certificates

Lesson 3 – Certificate Chains Explained

Lesson 4 – Debug TLS with OpenSSL

Lesson 5 – Verify Certificate Chains

Lesson 6 – Creating CSRs with OpenSSL

Lesson 7 – Working with PKCS12 Certificates

Lesson 8 – Java Keystores and keytool

Lesson 9 – Certificate Expiration Monitoring

Lesson 10 – Automating Certificate Renewal

Lesson 11 – Common TLS Errors

Lesson 12 – PKI Architecture for DevOps

Recent Posts

  • Apache mod_auth_cas: Protect Web Applications with Apereo CAS and Docker
  • Apache mod_auth_mellon: Configure SAML SSO & Docker
  • Configure OpenID Connect (OIDC) in Apereo CAS 7.3 and 8
  • Certificate Ownership Is an Operating Model Problem, Not a Tooling Problem
  • OpenSSL dgst: Create Checksums and Verify Digital Signatures

Footer

  • Twitter
  • YouTube
Mister PKI

Practical security engineering for the systems that establish trust.

Learn OpenSSL Keytool Free training
Work together PKI consulting CAS consulting Sponsored contributions
Site About Support Mister PKI Cookie policy Search
© 2026 Mister PKI Secure systems. Clear guidance.