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

by on October 10, 2007 · 30 comments· LAST UPDATED June 28, 2012

in , ,

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

Tweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?

{ 30 comments… read them below or add one }

1 cindy watson January 23, 2009 at 3:58 am

#service iptables save #service iptables stop #chkconfig iptables off


2 jottos March 13, 2009 at 8:38 am

thanks, right to the point, just what I needed.


3 evil DBA April 24, 2009 at 12:46 am

gracias me fue muy útil!!!


4 julien alarmiste August 19, 2009 at 8:21 pm

thanks very much;
i’m french and, also, I need just this command for my appache server … !!


5 Tommy March 29, 2010 at 9:50 am

Excellent, you save my day


6 Randy July 31, 2010 at 3:20 pm

How do you restart it?


7 Dean Hales September 21, 2010 at 10:18 pm

service iptables restart


8 Sayeed Salahuddin October 5, 2010 at 3:02 pm

Excellent, it made my apache and vncserver connect successfully :)



9 Raju November 17, 2010 at 11:42 am

Thanks a ton. My problem is solved and i can leave home now.


10 Private December 3, 2010 at 10:10 pm

Thank you! :)


11 SF March 9, 2011 at 11:27 am

Thank You!
Worked Perfectly!


12 matt March 28, 2011 at 3:47 pm

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.


13 Mughees Hafeez June 28, 2011 at 5:40 am

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


14 k3b July 2, 2011 at 3:01 pm

Thanks, this is the right way to disable firewall in my case was under CentOS server


15 Josh July 28, 2011 at 5:15 am

Hi there, thanks for this. Just wondering, what does the service “save” command do?


16 Sumeet September 2, 2011 at 3:56 pm

G8 ! to the point and well documented .


17 LeeThong October 2, 2011 at 7:36 am

thanks !


18 Rob December 22, 2011 at 11:58 am

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.


19 darrell January 18, 2012 at 3:14 am

thanks so much ,I spent 2 days trying to access home server, Now works fine
You made my day !!!


20 Anil January 24, 2012 at 5:17 am

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.


21 veve March 27, 2012 at 7:45 pm

Is there any command to check the status of the firewall??


22 nixCraft March 27, 2012 at 8:37 pm

As root run:

/sbin/iptables -L -n -v
/sbin/service iptables status
/sbin/service ip6tables status


23 Habeeb October 24, 2012 at 1:37 pm

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.???


24 Ben Sodenkamp May 27, 2014 at 10:45 pm

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.



25 Rick December 20, 2012 at 4:00 am

You can set up a batch script but i think there should be a way to permeanently stop it.
I think its easier to use the GUI for the firewall but i would recommend to use the command line as well to understand how it works. (Just in case your GUI does not work….)


26 jessic March 12, 2014 at 5:06 pm

Tu aporte me ha salvado de 3 dias de no poder conectar mi aplicacion al servidor de BD.. thanks!


27 cristian June 10, 2014 at 9:09 pm

Oscar dice que le salvaste 4 días de trabajo duro e intenso.

Gracias x el aporte


28 Wellington Torrejais da Silva June 24, 2014 at 1:56 pm



29 Marco January 7, 2015 at 11:41 pm

Great, thanks!


30 global74 February 11, 2015 at 11:42 pm

Very useful information. Thanks very much for the insight!


Leave a Comment

Tagged as: , , , , , , , , , , , ,

Previous Faq:

Next Faq: