How to open ports on CentOS 7 firewall.
To open a firewall port on CentOS 7, you can follow these steps:
- Check the status of the firewall.
- Check the status of the firewalld service using systemctl command.
- Start the firewall if it is not running.
- Initiate the firewalld service using sudo systemctl start.
- View the list of currently open ports.
- Show me a list of ports using firewall-cmd with sudo.
- Open port:
- 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”
- Please replace “port number” with the desired port number, and replace “protocol” with the protocol used by the port (such as TCP or UDP).
- Update firewall rules:
- Please reload the firewall by using the command “sudo firewall-cmd –reload.”
- Confirm if the port has been successfully opened.
- 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.