Linux Netfilter discussions
 help / color / mirror / Atom feed
From: /dev/rob0 <rob0@gmx.co.uk>
To: netfilter@vger.kernel.org
Subject: Re: old question revisited: can rely in 'iptables-restore' format?
Date: Wed, 22 Aug 2012 12:35:12 -0500	[thread overview]
Message-ID: <20120822173512.GO3672@harrier.slackbuilds.org> (raw)
In-Reply-To: <201208202221.37529.neal.p.murphy@alum.wpi.edu>

On Mon, Aug 20, 2012 at 10:21:37PM -0400, Neal Murphy wrote:
> On Monday 20 August 2012 20:30:26 /dev/rob0 wrote:
> > The main benefit is that iptables-restore is atomic. All changes
> > are committed in one pass. Any error in the ruleset means your
> > existing ruleset is not replaced.
> 
> [Minor digression]
> By 'atomic', do you mean that all of the changes are made with a 
> single COMMIT, regardless of how many tables are accessed and 
> regardless of how many rules are processed?

I don't know. I was hoping that someone familiar with the source 
would answer.

> It's been my experience that there is an implicit COMMIT at every 
> table change, and there is a ballpark limit of around 20,000 rules 
> per commit. Thus:

>   - if the file you are feeding to iptables-restore references one
>     table only and contains fewer than around 20,000 rules, the
>     operation will be atomic.

>   - if the file you are feeding to iptables-restore references more
>     than one table and contains fewer than around 20,000 rules per
>     table, then only the changes *per table* will be atomic.
>   - If the changes to a table contain more than around 20,000 rules,
>     then that operation will require more than one COMMIT and will
>     NOT be atomic.
> 
> When relatively small change sets are involved, I agree that 
> iptables-restore is atomic. But when very large change sets are 
> involved, I disagree: iptables-restore is *not* necessarily 
> atomic. To be pedantic, it would be correct to say that 
> iptables-restore operates atomically only under certain
> conditions.

Interesting, thanks. I think my post was right in the usual case, 
however, and that your examples of >20K rules might be better
handled by ipset(8).
-- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:

  reply	other threads:[~2012-08-22 17:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 12:48 netfilter packetflow A G
2012-08-17 14:04 ` Jan Engelhardt
2012-08-20 23:26 ` old question revisited: can rely in 'iptables-restore' format? Peter Grandi
2012-08-21  0:30   ` /dev/rob0
2012-08-21  2:21     ` Neal Murphy
2012-08-22 17:35       ` /dev/rob0 [this message]
2012-08-22 19:12         ` Jan Engelhardt
2012-08-23 19:20     ` Peter Grandi
2012-08-23 20:35       ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120822173512.GO3672@harrier.slackbuilds.org \
    --to=rob0@gmx.co.uk \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox