How to check open ports in firewalld on Linux?
In Linux, you can use the following command to view the open ports in firewalld:
- Firstly, make sure that the firewalld service is installed and running. You can use the following command to check the status of the firewalld service:
systemctl status firewalld
- List the ports that have been opened in firewalld using the following command:
firewall-cmd --list-ports
This command will show a list of all open ports.
- If you only want to check if a specific port is open, you can use the following command:
firewall-cmd --query-port=<port_number>/tcp
Replace
These commands can help you check the open ports in firewalld and the status of specific ports.