A packaged service can listen successfully while firewalld still blocks clients because the zone has no matching allow rule. A predefined firewalld service, such as http or https, opens the ports and helpers defined by the service profile instead of relying on a hand-entered port list.
firewall-cmd applies zone changes to either runtime state or permanent configuration. Adding the service without --permanent opens it immediately but loses the rule after a reload or restart; adding the same service with --permanent saves the rule that firewalld loads later.
The steps use the http service in the public zone and a client request to an HTTP listener as the smoke test. Replace the service and zone with the active traffic path on the host, especially on multi-interface servers where the default zone may not handle the application network.
Related: Check active firewalld zones
Related: Open a permanent firewalld port
Related: Create a custom firewalld service
$ sudo firewall-cmd --state running
$ sudo firewall-cmd --get-active-zones public (default) interfaces: eth0
If no interface or source is listed, check the fallback zone with sudo firewall-cmd --get-default-zone before adding the service. Related: Check active firewalld zones
$ sudo firewall-cmd --info-service=http http ports: 80/tcp protocols: source-ports: modules: destination: includes: helpers:
Use sudo firewall-cmd --get-services when the service name is not known. If the application has no suitable predefined profile, create a custom service instead of opening unrelated raw ports. Related: Create a custom firewalld service
$ sudo firewall-cmd --zone=public --add-service=http success
Adding a service to the wrong zone can expose the application on an unintended network or leave the intended client path blocked.
$ sudo firewall-cmd --permanent --zone=public --add-service=http success
$ sudo firewall-cmd --zone=public --list-services dhcpv6-client http ssh
$ sudo firewall-cmd --permanent --zone=public --list-services dhcpv6-client http ssh
$ sudo firewall-cmd --reload success
A reload replaces runtime-only changes with the permanent configuration. If the permanent command was missed, the service disappears from the live rules after this step.
$ sudo firewall-cmd --zone=public --list-services dhcpv6-client http ssh
$ sudo firewall-cmd --permanent --zone=public --query-service=http yes
$ curl -sS http://web01.example.net/ firewalld service allow ok
The application must already be listening on the ports defined by the service profile. If the firewalld rule is present but the request still fails, check the service listener, routing, and upstream firewalls before widening the host rule.