CP – Firewall Installation and Configuration

A firewall is a program that surrounds the interface between a private network and the rest of the Internet. It follows pre-configured rules that allow certain traffic to pass through from the internet to the private network and blocks those that are unwanted and potentially harmful.

To configure the Iptables firewall first we need to disable firewalld by typing:

$ systemctl disable firewalld
$ systemctl stop firewalld

iptables is a user-space utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall. To install iptables by typing the following:

$ yum -y install iptables-services
-or-
$ rpm -q iptable

To install and execute the system-config-firewall tool type:

$ yum -y install system-config-firewall
$ system-config-firewall

After running a previous command we should get a interface of the firewall where we can manipulate the firewall settings. We need to follow the following flow in order to setup firewall:

  1. Click the Wizard button on the top left corner.
  2. Leave the “Information” page by clicking on Forward.
  3. For Firewall Setting, keep the default “system with network access” and click on Forward.
  4. For user skill level, keep the default “Beginner” and click on Forward.
  5. For Configuration, select Load “Server” configuration and click on OK, then click the Apply button on the top left corner and click on YES.
  6. Click on X to close the firewall configuration.

To check if the following to make certain the rules were set up, we need to see if the actual file was created after GUI configuration.

$ ls /etc/sysconfig/iptables

After successful confirmation of all firewall settings we need to start the firewall service and enable it after each boot up in case of the DDoS attacks

$ systemctl start iptables # to start service
$ systemctl enable iptables # to enable on boot up service
$ sytemctl status iptables # check the status of the service
$ systemctl stop iptables # stop service


Design a site like this with WordPress.com
Get started