Jump to Navigation

303 - Firewall in CentOS 7

The firewall service in CentOS provided by firewalld is dynamic rather than static because changes to the configuration
can be made at anytime and are immediately implemented, there is no need to save or apply the changes.
No unintended disruption of existing network connections occurs as no part of the firewall has to be reloaded.

To enable firewalld, run the following command as root:

$ systemctl enable firewalld

To start firewalld, run the following command as root:

$ systemctl start firewalld

To check the status of firewalld, run the following command as root:

$ systemctl status firewalld

or

$ firewall-cmd --state

If you want to use iptables on CentOS / RHEL 7 instead of firewalld, Please do the following steps.

1. Disable the new firewalld.

$ systemctl stop firewalld
$ systemctl disable firewalld
$ systemctl mask firewalld

2. Install iptables

yum install iptables-services

3. Enable iptables

$ systemctl enable iptables
$ systemctl enable ip6tables

4. Start the services

$ systemctl start iptables
$ systemctl start ip6tables

(* systemctl may be used to introspect and control the state of the "systemd" system and service manager.)

 



Main menu 2

Story | by Dr. Radut