How To: Disable Firewall on RHEL / CentOS / RedHat Linux

Posted on in Categories , , , last updated June 28, 2012

I don’t want firewall because I only run one http (port 80) public service. How do I turn off or disable firewall permanently under RHEL / Fedora Linux / Red Hat Enterprise Linux and CentOS Linux?

iptables is administration tool / command for IPv4 packet filtering and NAT. You need to use the following tools:

[a] service is a command to run a System V init script. It is use to save / stop / start firewall service.

[b] chkconfig command is used to update and queries runlevel information for system service. It is a system tool for maintaining the /etc/rc*.d hierarchy. Use this tool to disable firewall service at boot time.

How Do I Disable Firewall?

First login as the root user.

Next enter the following three commands to disable firewall.
# service iptables save
# service iptables stop
# chkconfig iptables off

If you are using IPv6 firewall, enter:
# service ip6tables save
# service ip6tables stop
# chkconfig ip6tables off

Check out related media

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

36 comment

  1. Thanks… graphical install of RHEL5.5 automatically starts the firewall (and selinux in paranoid mode) which completely compromises using it as a pxe server… this fixed the last issue quickly.

  2. Dear Thanks, for such a productive commands… most of the user have the problem after installing httpd that its not showiing in the browser….. a tip for them disable SElinux and as well as firewall method given above… it will work fine insh ALLAH

  3. Just a question:

    if i only stop iptables service without stopping ip6tables, does the firewall still block all connections even if they are ipv4? Or it only stops ipv6 connections?
    Iptables service is for ipv4 connections, and ip6tables for ipv6 ones, so i would like to know if stopping iptables is enough to disable firewall, or it still remain active if ip6tables is active.
    Thanks
    Rob

  4. Thanks,
    This helped a lot.
    I was trying to execute a command using rsh on one of my RHEL servers in a private network but was unable to do that. Turns out that all I needed was to disable the firewall.

  5. Dear All,

    Can anyone tell me how to stop the iptables permanently after restart the server.
    Actually i face a problem in Centos 6.3 x86_64 version that i stop the iptables as you mentioned.
    # service iptables save
    # service iptables stop
    # chkconfig iptables off
    But after restarting the server again the iptables is on after doing chkconfig also can anyone help me in this.???

    1. I replaced the /sbin/iptables binary with a script that told me things about the process. Tracked the issue to libvirtd. If you don’t need libvirtd, try turning it off. This worked for me.

      Ben

Leave a Comment