Iptables is a built in firewall in most Linux systems. firewall that provides protection between your server (workstation) and damaging content on the Internet or network. It will try to protect your system against both malicious users and software such as viruses/worms.
In this article we’ll show you how to check the current status of the iptables firewall, and how to disable or enable it in CentOS.
Check the Status of The Iptables IPv4 Firewall
Run the following command to check the status of the iptables IPv4 firewall :
service iptables status
Check the Status of The Iptables IPv6 Firewall
Run the following command to check the status of the iptables IPv6 firewall :
service ip6tables status
Disable The Iptables Firewall
Run the following commands to stop the iptables firewall for IPv4 :
service iptables save service iptables stop chkconfig iptables off
Run the following commands to stop the iptables firewall for IPv6 :
service ip6tables save service ip6tables stop chkconfig ip6tables off
Enable The Iptables Firewall
Run the following commands to start the iptables firewall for IPv4 :
service iptables start chkconfig iptables on
Run the following commands to start the iptables firewall for IPv6 :
service ip6tables start chkconfig ip6tables on