Home » Linux » How to List Open Ports Using FirewallD in Linux

How to List Open Ports Using FirewallD in Linux

In this article, I show how to list open ports using FirewallD in Linux. In CentOS 7 the FirewallD is the default firewall program, as the same to other Red Hat, Fedora, and other popular Linux distributions. It is very simple to use command line interface (CLI) that’s a great alternative to iptabels. Now you going to see how to use the commands and should be same for any Linux distribution with FirewallD.

If you want to know more about FirewallD here you have an article.

Check the FirewallD status

First, check whether firewalld service is running with the below command.

Start the FirewallD Services

Here your firewalld services not in active run the following command to start the services.

Stop the FirewallD Services

To stop the firewalld services use the below command.

List the FirewallD Services

If you like to list overall FirewallD configuration use the following command to list.


If the services ssh dhcpv6-client services are enabled, that means the relevant port to these services is also open.

Check the opened ports

Using ssh you can find out what are the open ports are enabled with the following command.

In the below list, you can see the opened ports, the ssh service opens the TCP port 22 and UDP port 22.

List the Open Services

In the previous command sudo firewall-cmd –list-all list out all the FirewallD configurations, Here if you like to list only what services are allowed to have open ports use the below command.

List the Open Ports

If you like to list out the open ports in your server using the following command.

Was this article helpful?

Yes No

How can we improve it?


We appreciate your helpul feedback!

Your answer will be used to improve our content. The more feedback you give us, the better our pages can be.

Follow us on social media:

Facebook Pinterest


Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts.

Leave a Reply

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

Back to top