Firewall Configuration on CentOS 7
The firewall on CentOS 7 is configured through the firewalld service. The default firewall configuration is adequate for most situations, but it is possible to adjust the firewall configuration to better suit your needs.
To review the default firewall configuration, use the following command:
firewalld –get-default-policy
The output of this command includes the following information:
Name: default
Description: The default firewall policy.
Enabled: Yes
Policy: allow all
The default firewall policy is allow all. This means that all traffic will be allowed through the firewall.
If you want to restrict traffic to specific ports, you can modify the policy using the allow and deny options. For example, to allow traffic only on port 22 (IRC traffic), you would use the following command:.
firewalld –get-default-policy allow=22
To review the current firewall configuration, use the following command:
firewalld –get-active-firewall
Description: The current active firewall policy.
The current active firewall policy is allow all.