From: Grant Taylor <gtaylor@riverviewtech.net>
To: Mail List - Netfilter <netfilter@vger.kernel.org>
Subject: Re: Check for rule existence
Date: Mon, 14 Jun 2010 13:22:26 -0500 [thread overview]
Message-ID: <4C167362.1030201@riverviewtech.net> (raw)
In-Reply-To: <AANLkTimA4wYL8mouRjiygbldj9rLui_vhh1zemVRcmQK@mail.gmail.com>
On 06/14/10 12:23, Curby wrote:
> Just a quick note that you might want to look at iptables-save
> instead of vanilla iptables if you aren't already. The former
> command gives the rules in a sort of canonical form that is used for
> restoring rulesets. You'll have fewer spacing issues and such.
> Hopefully others will have more to add. =)
(iptables-save) Agreed.
I'd also recommend that you apply your rule and see how iptables-save
will regurgitate the same rule back at you. Especially if you are doing
a textual comparison of the rule.
If you aren't doing a textual comparison of the rule and are actually
breaking it out in to its individual elements (like command line
argument processing) you will have a better chance of matching the rule
on more systems. Something as simple as a different interface name will
throw off your textual match. I.e. "eth0" is actually "eth1".
Depending on how system agnostic you are trying to bee, processing the
rule as if it were a command line (looking for individual pieces) will
probably be the easiest to do.
Grant. . . .
next prev parent reply other threads:[~2010-06-14 18:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-14 17:16 Check for rule existence Mistick Levi
2010-06-14 17:23 ` Curby
2010-06-14 18:22 ` Grant Taylor [this message]
2010-06-14 18:24 ` Grant Taylor
2010-06-14 18:25 ` Grant Taylor
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=4C167362.1030201@riverviewtech.net \
--to=gtaylor@riverviewtech.net \
--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;
as well as URLs for NNTP newsgroup(s).