Iptables should be installed by default on all CentOS 3.x, 4.x and 5.x installations. You can check to see if iptables is installed on your system by:
# rpm -q iptables
Sample output
iptables-1.3.5-5.3.el5_4.1
How to enable firewall
Login as root and type the following command
# /etc/init.d/iptables start # chkconfig iptables on
If you are using IPv6, enter:
# /etc/init.d/ip6tables start # chkconfig ip6tables on
And to see if iptables is actually running, we can check that the iptables modules are loaded, type the following command
# lsmod | grep ip_tables
Something look like:
ip_tables 29288 1 iptable_filter x_tables 29192 6 ip6t_REJECT,ip6_tables,ipt_REJECT,xt_state,xt_tcpudp,ip_tables
How to disable firewall
Login as root and type the following command
# /etc/init.d/iptables stop # chkconfig iptables off
If you are using IPv6, enter:
# /etc/init.d/ip6tables stop # chkconfig ip6tables off
Related Posts:
- How To Flush/Remove All Iptables Rules In Linux
- How To Install Memcache PHP Extension
- chkconfig Command
- How To Install Lighttpd And PHP (PHP-FPM) On CentOS 6
- How Do I Block An IP Address On Linux Server ?
- Linux Start / Stop / Restart Apache Server
- How To Restart Networking Service In Linux
- Setting Up Password Aging In Linux
- How To Save/Restore Iptables Rules
- How to install IPTables on RedHat / Centos Linux