How to open firewall ports in firewalld on RHEL 7/8/9
RHEL 7/8/9
Log into the rhel server physically or ssh to the server.
firewall-cmd --get-services
if the service is listed whitelist the service by adding it to the current zone:
sudo firewall-cmd --permanent --add-service=SERVICENAME
If the service is not listed add the port to the current zone.
sudo firewall-cmd --permanent --add-port=1234/tcp
The firewalld needs to be re-loaded or restarted to apply the changes:
firewall-cmd --reload
To verify the current open ports and services:
firewall-cmd --list-all