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

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • Buy SSL Certificates
  • Blog
  • OpenSSL
  • Keytool
  • SSL Tools
  • Donate
  • Cookie Policy (EU)

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

Buy SSL Certificates

The SSL Store

Comodo Store

Sectigo Store

RapidSSL

Recent Posts

  • Firewall Redhat
  • openssl verify – Verify a certificate and certificate chain
  • openssl s_client commands and examples
  • admincount Active Directory
  • Apereo CAS Custom Metadata Resolver

Footer

  • Twitter
  • YouTube

Pages

  • About Mister PKI
  • Blog
  • Compare and Buy Affordable PKI Certificates
  • Contact Us
  • Cookie Policy (EU)
  • Full Disclosure
  • Privacy Policy
  • SSL Tools – Certificate Decoder and Certificate Checker

Copyright © 2025