Posts Under Category: firewall

Syn-flood attacks are common these days. Syn-flood attack means that the attackers open a new connection to the server, but do not state what they want. They just want to take up servers resources and increase server load.

This type of attack can be controlled by adding a rule in IPTable to reject syn-flood attacks. Login to your server as root via SSH, and run following commands:
read more

This tutorial explains how you can start and stop firewall on a CentOS / RedHat Linux server.

How to Stop / Disable firewall

Below commands will stop / disable firewall of a redhat / centos server. Login to your server as root via SSH and run following commands:

service iptables save
service iptables stop
chkconfig iptables off

For IPv6 firewall, use below commands:

service ip6tables save
service ip6tables stop
chkconfig ip6tables off

How to start firewall

Run below commands to start firewall.

chkconfig iptables on
service iptables start

For IPv6 firewall, use below commands:

chkconfig ip6tables on
service ip6tables start

Our Recommended VPS Hosting

This tutorial explains how you can list all current iptables rules on a RedHat / CentOS Linux server, and how you can clear / flush current iptables rules.

How to list current iptables rules

Below command will list of current iptables rules of your CentOS / RedHat Linux server.

iptables -L

How to Clear / Flush iptables rules

Use below command to delete / clear / flush all current iptables rules of your CentOS / RedHat Linux server.

iptables -F

If your server went down after flushing iptables, please refer to following tutorials:
Solution – Server Down after Flushing IPtables

Our Recommended VPS Hosting

This tutorial explains how you can start, stop and restart iptables rules of your server firewall. This tutorial is applicable for CentOS / RedHat Linux servers.

How to start iptable

service iptables start

OR

/etc/init.d/iptables start

How to stop iptable

service iptables stop

OR

/etc/init.d/iptables stop

How to restart iptable

service iptables restart

OR

/etc/init.d/iptables restart

Our Recommended VPS Hosting

Recently one of my vps (CentOS) went down after flushing / clearing iptables rules using below command:

iptables -F

The above command will flush/clear all current firewall rules of your CentOS / Linux server.

Here is how I fixed it. I just restarted iptables rules using below command and my VPS was UP.

service iptables restart

You can also use below command to restart iptables rules.

/etc/init.d/iptables restart

Our Recommended VPS Hosting

If you want to block a complete IP range in CSF firewall, please follow these steps:

Let’s say you want to block following IP range:

58.253.xxx.xxx

Step 1:

Login in root WHM.

Step 2:

Navigate to: WHM >> Plugins >> ConfigServer Security&Firewall

Step 3:

Block following IP using Quick Deny box.

58.253.0.0/16

Done!!!
You may need to restart CSF firewall after adding / removing IPs.
You can also block from SSH using following SSH command:

csf -d 58.253.0.0/16

Quick Note

To block 111.xxx.xxx.xxx range, use following rule

111.0.0.0/8

To block 111.111.xxx.xxx range, use following rule

111.111.0.0/16

To block 111.111.111.xxx range, use following rule

111.111.111.0/24

Our Recommended Dedicated Server