M
M
memba2014-09-04 13:26:22
linux
memba, 2014-09-04 13:26:22

No iptables file in centOS 6, how to properly generate it?

Hey!
Today I switched to CentOS 6 from the fifth version... many surprises.
Can't find iptables file. It's not in /etc/sysconfig/iptables.
So far, the ports have been opened simply with commands like:

iptables -I INPUT -p tcp --dport 80 -m state --state NEW -j ACCEPT

After restarting the server, the rules are applied, but where do they come from?
I decided to generate the file manually:
# service iptables save
The file was created, but only those rules that I set manually fit there. For example, there is no open port 22 there, and a bunch of other rules.
Why so, where is it all stored?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
s1dney, 2014-09-04
@s1dney

iptables-save > /etc/sysconfig/iptables
/etc/sysconfig/iptables - default system config, rules are loaded from it at boot

I
Igor, 2014-09-04
@merryjane

Look in the /etc/sysconfig/network-scripts directory to see if there is any ifup-* script in there .
The behavior you describe is not default for centos6.

M
Maxim Kovalenko, 2014-11-04
@maxxx_kovalenko

Try to generate /etc/sysconfig/iptables with the system-config-firewall-tui utility
The package itself is called system-config-firewall-tui-1.2.27-5.el6.noarch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question