You can check the status of the Firewalld service to see if it is running:
[root@localhost ~]# systemctl status firewalld
The output will indicate whether Firewalld is active and running.
By default, incoming requests for services are mostly not allowed. If you are using the Firewalld service, you will need to modify firewall settings manually to allow incoming requests for specific services. You can refer to this resource for basic firewall operations and settings.
Please note that configuration examples for CentOS Stream 9 on this site assume that the Firewalld service is always enabled.
If you don't need the Firewalld service for certain reasons, such as having other firewall machines running in your local network, you can stop and disable the Firewalld service on your CentOS Stream server:
# Stop the service
[root@localhost ~]# systemctl stop firewalld
# Disable the service
[root@localhost ~]# systemctl disable firewalld
This will stop the Firewalld service and prevent it from starting automatically on boot.
To allow incoming traffic on specific ports, you can use the following command:
# Allow incoming traffic on port 80 (HTTP)
[root@localhost ~]# firewall-cmd --add-port=80/tcp --permanent
Replace 80 with the desired port number and protocol (e.g., tcp or udp) as needed.
To deny incoming traffic on specific ports, you can use the following command:
# Deny incoming traffic on port 22 (SSH)
[root@localhost ~]# firewall-cmd --remove-port=22/tcp --permanent
Replace 22 with the port number and protocol you want to deny.
Remember to reload the firewall configuration after making changes:
[root@localhost ~]# firewall-cmd --reload
This ensures that the changes take effect.