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

by Vivek Gite on October 10, 2007 · 20 comments

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

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 20 comments… read them below or add one }

1 cindy watson January 23, 2009

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

Reply

2 jottos March 13, 2009

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

Reply

3 evil DBA April 24, 2009

gracias me fue muy Ăștil!!!

Reply

4 julien alarmiste August 19, 2009

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

Reply

5 Tommy March 29, 2010

Excellent, you save my day

Reply

6 Randy July 31, 2010

How do you restart it?

Reply

7 Dean Hales September 21, 2010

service iptables restart

Reply

8 Sayeed Salahuddin October 5, 2010

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

thanks,
Sayeed

Reply

9 Raju November 17, 2010

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

Reply

10 Private December 3, 2010

Thank you! :)

Reply

11 SF March 9, 2011

Thank You!
Worked Perfectly!

Reply

12 matt March 28, 2011

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.

Reply

13 Mughees Hafeez June 28, 2011

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

Reply

14 k3b July 2, 2011

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

Reply

15 Josh July 28, 2011

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

Reply

16 Sumeet September 2, 2011

G8 ! to the point and well documented .

Reply

17 LeeThong October 2, 2011

thanks !

Reply

18 Rob December 22, 2011

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

Reply

19 darrell January 18, 2012

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

Reply

20 Anil January 24, 2012

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.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 7 + 2 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: