On CentOS 8, the default firewall is firewalld, which is used to manage iptables rules on the server. To enable and start the firewalld service on the server, run the following commands.
To open an incoming connection to a specific service such as SSH, you need to verify that the service is present in the firewalld rules and, then, add the rule for the service by adding --permanent switch to commands as below
If you wish to open incoming connections to other network services such as HTTP or SMTP, just add the rules as shown by specifying the service name.
To view all firewall rules on the server, run the following command.