Posts Under Category: iptables

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