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: Mon, 20 Aug 2012 19:30:26 -0500	[thread overview]
Message-ID: <20120821003026.GD3672@harrier.slackbuilds.org> (raw)
In-Reply-To: <20530.51137.458307.357243@tree.ty.sabi.co.UK>

On Tue, Aug 21, 2012 at 12:26:57AM +0100, Peter Grandi wrote:
> Perhaps it is useful to ask again an old question:
> 
> Is the format of files produced by 'iptables-saved' and consumed
> by 'iptables-restore' still considered an internal, undocumented
> format that may change at any time?
> 
> How stable is in practice that format?
> 
> Because I reckon that format has been stable for at least 10
> years, and I wonder whether it may be desirable to write
> firewall configurations directly in it, rather than using long
> 'iptables' command shell scripts.

I can't say why there's no official iptables-save(5) manual page, 
but I can definitely say that it IS desirable and recommended to
use iptables-restore rulesets in your boot sequence. Most major 
distros that provide rulesets do use iptables-save and 
iptables-restore, and this has been the case for many years.

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.

iptables OTOH has to read and rewrite the entire ruleset for each 
command given, and there is a potential for race conditions if a 
script is triggered to run before the previous run completed.
-- 
  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-21  0:30 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 [this message]
2012-08-21  2:21     ` Neal Murphy
2012-08-22 17:35       ` /dev/rob0
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=20120821003026.GD3672@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