Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to disable the firewall with no luck. I have tried:

  • Going through System->Administration->Firewall and disabling it there.
  • Running 'iptables -F' and then /etc/init.d/iptables save
  • I've tried disabling SELinux

Whenever I reboot, the iptables rules are still there. If I run '/etc/init.d/iptables restore' then I get an empty list, but once I reboot all the rules are back. It seems like some other process is starting iptables and populating it with rules

share|improve this question
    
execute iptables -nL and compare this with /etc/sysconfig/iptables to see if rules from this file are loaded if not try to find files in your system with rules currently loaded maybe then you find what app is using iptables –  B14D3 Sep 27 '12 at 6:37
    
Execute 'service iptables stop' on redhat derivitives to stop a service. (Only until next reboot) Use chkconfig to disable services at boot time. –  Ryan Griggs May 28 at 2:05
    
Out of morbid curiosity, why do you want to completely disable iptables in the first place? You're just replacing it with a different firewall, right? Not... I mean you're not actually seriously considering not having a firewall at all, right? –  Parthian Shot Jul 17 at 19:49

4 Answers 4

I'm not sure because I had never use CentOS 3 but in newer version disabling iptables on startup can be accomplished by executing: chkconfig iptables off

Rules in Centos 5 and 6 are stored in /etc/sysconfig/iptables

share|improve this answer
    
I have disabled iptables with chkconfig. iptables is not configured to run on startup, but it looks like some other process is starting it up and adding rules. –  njc Sep 26 '12 at 13:38

/etc/sysconfig/system-config-firewall contains a line that the gui seems to read to determine the firewall state. Setting this to --disabled in addition to the chkconfig iptables off instructions seems to work for me.

share|improve this answer

It's possible some other firewall software has been installed and enabled to start on boot that is using iptables. If the software uses traditional init scripts it is likely it has a file in /etc/init.d/. If that is the case you may be able to find it by looking for all init scripts with a reference to iptables by grepping through the init scripts, for example:

grep -li iptables /etc/init.d/*

The service would also likely be configured to start in your default runlevel, which you can identify and disable with the command chkconfig.

share|improve this answer

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

share|improve this answer
    
libvirtd should only be adding its own firewall rules, not restoring other rules. –  Michael Hampton May 28 at 1:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.