All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herve Eychenne <rv@wallfire.org>
To: Henrik Nordstrom <hno@marasystems.com>
Cc: Netfilter Development <netfilter-devel@lists.netfilter.org>
Subject: Re: iptables and iptables-restore syntaxical testing
Date: Sun, 22 Aug 2004 21:53:17 +0200	[thread overview]
Message-ID: <20040822195317.GH4883@eychenne.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0408210203240.8001@filer.marasystems.com>

On Sat, Aug 21, 2004 at 02:09:55AM +0200, Henrik Nordstrom wrote:

> On Fri, 20 Aug 2004, Herve Eychenne wrote:

> >I just discovered iptables-restore -t today. It is exactly what I was
> >looking for, a mean to validate the iptables-save file format (possibly
> >generated by a tool like wallfire) without having to commit any changes
> >to the kernel.

> Please note that this is not 100% true. It will still trigger loading of 
> the specified table modules if not already loaded.

> Meaning that if you run "iptables-restore -t" on a ruleset including a 
> *nat table then iptable_nat will be loaded if it was not before.

I had already thought about this, and considered it not very harmful,
if documented.
But I had forgotten conntrack, which can be annoying, because of performance
penalty. You're absolutely right.
So the solution might be to track each kernel module insertion and unload
modules that were not inserted before on exit. A little heavy, but I
see no other way to test line validity as much as possible.
And we could even add an option that would test without inserting
kernel modules, if lighter testing is desired.

> >- I'm also looking for a way to restore only a particular table, and I
> > cannot think of an other option than
> > # iptables-restore -t table
> > to do that

> Just limit your input to the table you want to test.

Yes, but when you have a complete ruleset as a base, that requires
sed/awk/perl preprocessing. I agree that is not much of a problem by
itself, but if we can avoid that by adding only a very few lines of
code to iptables-restore, why not doing it?

 Herve

-- 
 _
(°=  Hervé Eychenne
//)
v_/_ WallFire project:  http://www.wallfire.org/

  reply	other threads:[~2004-08-22 19:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-20 16:57 iptables and iptables-restore syntaxical testing Herve Eychenne
2004-08-21  0:09 ` Henrik Nordstrom
2004-08-22 19:53   ` Herve Eychenne [this message]
2004-08-25  8:27 ` Martin Josefsson

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=20040822195317.GH4883@eychenne.org \
    --to=rv@wallfire.org \
    --cc=hno@marasystems.com \
    --cc=netfilter-devel@lists.netfilter.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 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.