3

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

3
  • 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, 2012 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. May 28, 2014 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? Jul 17, 2014 at 19:49

4 Answers 4

3

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

2

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

1
  • 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, 2012 at 13:38
1

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.

0

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

1
  • libvirtd should only be adding its own firewall rules, not restoring other rules. May 28, 2014 at 1:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .