How to open ports on CentOS 7 firewall.

To open a firewall port on CentOS 7, you can follow these steps:

  1. Check the status of the firewall.
  2. Check the status of the firewalld service using systemctl command.
  3. Start the firewall if it is not running.
  4. Initiate the firewalld service using sudo systemctl start.
  5. View the list of currently open ports.
  6. Show me a list of ports using firewall-cmd with sudo.
  7. Open port:
  8. Grant access to a specific port/protocol in the public zone of the firewall using the command “sudo firewall-cmd –zone=public –add-port=port_number/protocol –permanent”
  9. Please replace “port number” with the desired port number, and replace “protocol” with the protocol used by the port (such as TCP or UDP).
  10. Update firewall rules:
  11. Please reload the firewall by using the command “sudo firewall-cmd –reload.”
  12. Confirm if the port has been successfully opened.
  13. Please list the ports using the command sudo firewall-cmd.

In this way, you have successfully opened the specified port on the CentOS 7 firewall.

bannerAds