All of lore.kernel.org
 help / color / mirror / Atom feed
* When do iptables take effect when using iptables-restore
@ 2005-05-13 15:35 Joubert Berger
  2005-05-13 15:58 ` Rakotomandimby (R12y) Mihamina
  0 siblings, 1 reply; 3+ messages in thread
From: Joubert Berger @ 2005-05-13 15:35 UTC (permalink / raw)
  To: netfilter

Say I have 10,000 rules loaded.

I now want to update them, so I edit my file and then run
iptables-restore to load the new rules.

During all this iptables is applying policy on packets.  So, what
happens between the time I start running iptables-restore and when it
finishes it?  Does it flush all the  rules and then load the news
ones?  Does that mean during this time I don't have iptables
enforcement going on?   Or does Iptables-restore load all the rules in
memory and then, when the commit happens, moves pointers around so
that enforcement is in effect all the time?

Another question I have is about connection tracking.  Do they get
flushed when we do a save-restore?  Say we allowed 10.10.3.3 through,
and currently  connection tracking is tracking this IP.  Now, we add a
rule to block 10.10.3.3.  But, connection tracking  is allowing it
through.  How does one solve this problem?

--joubert


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: When do iptables take effect when using iptables-restore
  2005-05-13 15:35 When do iptables take effect when using iptables-restore Joubert Berger
@ 2005-05-13 15:58 ` Rakotomandimby (R12y) Mihamina
  2005-05-13 19:22   ` Joubert Berger
  0 siblings, 1 reply; 3+ messages in thread
From: Rakotomandimby (R12y) Mihamina @ 2005-05-13 15:58 UTC (permalink / raw)
  To: netfilter

On Fri, 2005-05-13 at 11:35 -0400, Joubert Berger wrote:
> Say I have 10,000 rules loaded.

God!

> I now want to update them, so I edit my file and then run
> iptables-restore to load the new rules.

Why wouldn't you deal with a shell script to do so?
With a shell script you would exactly know what rules are applied at a
moment.

> During all this iptables is applying policy on packets.  So, what
> happens between the time I start running iptables-restore and when it
> finishes it? 

If you update your rules, one thing you will have to do is to flush,
anyway. If you dont, you'd append your updates to the existent rules. So
once you flushed, I think your "reore" file is read line by line and the
rules are applied as well as it is read.

But that's just my opinion. I habe no technical arguments, as you
see :-)


-- 
ASPO Infogérance       http://aspo.rktmb.org/activites/infogerance
Unofficial FAQ fcolc   http://faq.fcolc.eu.org/
LUG sur Orléans et alentours (France).
Tél : 02 34 08 26 04 / 06 33 26 13 14



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: When do iptables take effect when using iptables-restore
  2005-05-13 15:58 ` Rakotomandimby (R12y) Mihamina
@ 2005-05-13 19:22   ` Joubert Berger
  0 siblings, 0 replies; 3+ messages in thread
From: Joubert Berger @ 2005-05-13 19:22 UTC (permalink / raw)
  To: netfilter

On 5/13/05, Rakotomandimby (R12y) Mihamina
<mihamina.rakotomandimby@etu.univ-orleans.fr> wrote:
> 
> > I now want to update them, so I edit my file and then run
> > iptables-restore to load the new rules.
> 
> Why wouldn't you deal with a shell script to do so?
> With a shell script you would exactly know what rules are applied at a
> moment.
> 

It is done in a shell script :-)

> > During all this iptables is applying policy on packets.  So, what
> > happens between the time I start running iptables-restore and when it
> > finishes it?
> 
> If you update your rules, one thing you will have to do is to flush,
> anyway. If you dont, you'd append your updates to the existent rules. So
> once you flushed, I think your "reore" file is read line by line and the
> rules are applied as well as it is read.
> 

If I was executing individual iptables commands, I understand what the
impact is.  Once I flush the tables there would be no rules there. 
Then, as I add each policy, I would know that the policy changes as I
add each rule one at a time.

But I am not sure how iptables-restore works.  From what I have read,
it is considered an atomic action.  But, what does that mean?  Build
the entire rules in kernel memory and then at the end hook this into
the iptables search mechanism?  Or does it clear the table, then adds
each rule one at the time at the same time it is also evaluating
packets coming in.  Another way of asking it might be, is the atomic
operation at the iptables-restore level or at the kernel level?  Not
sure if I am explaining what I am looking after :-)

--joubert


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-13 19:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-13 15:35 When do iptables take effect when using iptables-restore Joubert Berger
2005-05-13 15:58 ` Rakotomandimby (R12y) Mihamina
2005-05-13 19:22   ` Joubert Berger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.