Opening a raw port in firewalld is for applications that do not have a suitable predefined service. The rule must go into the zone that handles the incoming traffic, and it must be saved permanently when the application should remain reachable after a reload or reboot.
firewalld keeps runtime rules separate from permanent configuration. A normal --add-port command changes the live firewall only, while the same command with --permanent writes the saved configuration that firewalld loads after a reload, restart, or boot.
The commands use 8443/tcp in the public zone. Replace the port, protocol, and zone with the values for the application path being exposed, and prefer a predefined or custom service when the application has several ports or needs a named policy object.
Related: Check active firewalld zones
Related: Allow a service in firewalld
Related: Save runtime firewalld rules permanently
$ sudo firewall-cmd --state running
$ sudo firewall-cmd --get-active-zones public (default) interfaces: eth0
If the host has no active zone binding, check the fallback zone with sudo firewall-cmd --get-default-zone before choosing where to add the port.
Related: Check active firewalld zones
$ sudo firewall-cmd --zone=public --add-port=8443/tcp success
Opening a port in the wrong zone can expose the application on an unintended network. Confirm the active zone before applying the command on an internet-facing or multi-interface host.
$ sudo firewall-cmd --permanent --zone=public --add-port=8443/tcp success
Use /udp instead of /tcp for UDP listeners. firewalld also accepts supported port ranges such as 9000-9010/tcp.
$ sudo firewall-cmd --zone=public --list-ports 8443/tcp
$ sudo firewall-cmd --permanent --zone=public --list-ports 8443/tcp
$ sudo firewall-cmd --reload success
A reload replaces runtime-only changes with the permanent configuration. If the permanent command was missed, the port disappears from the live rules after this step.
$ sudo firewall-cmd --zone=public --list-ports 8443/tcp
$ sudo firewall-cmd --permanent --zone=public --query-port=8443/tcp yes
$ nc -vz app01.example.net 8443 Connection to app01.example.net 8443 port [tcp/*] succeeded!
The application must already be listening on the port. If the firewalld rule is present but the connection still fails, check the service listener, host routing, and any upstream firewall before widening the host rule.