R
R
Rad1us2015-08-19 05:56:08
linux
Rad1us, 2015-08-19 05:56:08

What is the difference between a script and a simple file. On the example of iptables in centos7?

I started learning Linux, armed myself with two books and the CentOS7 distribution. I started setting up iptables, read off-line documentation and even wrote a few simple rules. By default, I did everything in the /etc/sysconfig/iptables.
A banal question arose - one way or another, you need to use a script for iptables, but I don’t understand how it fundamentally differs from a regular file. Only by the fact that its use exempts from the constant restart of the service when editing the rules?
And secondly, if I already have a /etc/sysconfig/iptables file at the moment and it works, what should I do to replace it with a script? Write a script, put it somewhere, delete the iptable file? And how then will the service understand that now the rules need to be picked up from the script, and not from the file? Where to register it?
Questions are banal, I understand, but I did not find a clear answer to them.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Aitkulov, 2015-08-19
@Scarfase1989

As far as I know Cenots7 uses wirewalld. Personally, I like it more because it's easy for a beginner. But purely on your question it is not at all clear what you want to do and why ?!

P
Puma Thailand, 2015-08-19
@opium

you need the script in systems where iptables is not configured at the system level, for example, in ubuntu, there is /etc/sysconfig/iptables in centos and it is logical to use it, since the iptables start restart stop service works fine,
it understands it because there is a corresponding script in init d or in systems d

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question