Closing a raw firewalld port removes a zone allowance for traffic that was opened by port number rather than by service name. Check both runtime and permanent configuration before changing it, because a port can be active now but absent from the saved configuration, or saved permanently but not loaded into the running firewall yet.
The example closes TCP port 8443 in the public zone. Removing a port rule does not stop the application listener; it only removes the firewalld allowance that let clients reach that listener through the selected zone.
Remove the runtime rule for immediate effect and the permanent rule so the port does not return after a reload. If the same traffic is allowed through a service, rich rule, source zone, policy, or direct rule, remove or narrow that separate allowance as part of the same change window.
Related: Open a permanent port in firewalld
Related: Remove a service from firewalld
Related: Troubleshoot blocked firewalld connections
$ sudo firewall-cmd --state running
$ sudo firewall-cmd --get-active-zones public (default) interfaces: enp1s0
Related: Check active firewalld zones
$ sudo firewall-cmd --zone=public --query-port=8443/tcp yes
$ sudo firewall-cmd --permanent --zone=public --query-port=8443/tcp yes
$ sudo firewall-cmd --zone=public --remove-port=8443/tcp success
If the runtime query already printed no, continue with the permanent removal so the port does not appear after the next reload.
$ sudo firewall-cmd --permanent --zone=public --remove-port=8443/tcp success
$ sudo firewall-cmd --check-config success
$ sudo firewall-cmd --reload success
$ sudo firewall-cmd --zone=public --query-port=8443/tcp no
$ sudo firewall-cmd --permanent --zone=public --list-ports
An empty result means no raw ports are saved in that zone. Services or rich rules can still allow traffic on the same port.
$ nc -vz -w 2 app01.example.net 8443 nc: connect to app01.example.net port 8443 (tcp) failed: Connection timed out
If the client still connects, inspect services, rich rules, source-zone bindings, policies, direct rules, upstream firewalls, and the application listener path before treating the port as closed.