Enable the firewalld service:
# systemctl enable firewalld
Starting the firewalld service:
# systemctl start firewalld
Verifying that firewalld service is running:
# firewall-cmd --state
Checking the firewall default zone:
# firewall-cmd --get-default-zone
Opening a ports and service:
# firewall-cmd --zone=public --permanent --add-port=22222/tcp
# firewall-cmd --zone=public --permanent --add-service=ssh
Restarting the firewalld service:
# systemctl restart firewalld
Verifying open ports and services:
# firewall-cmd --list-all
public (default, active)
interfaces: enp0s25
sources:
services: dhcpv6-client ipp ipp-client mdns ssh
ports: 22222/tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
Also add the port that you opened to semanage if you have it running.
# semanage port -a -t ssh_port_t -p tcp 22222