Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Jim Laurino <nfcan.x.jimlaur@dfgh.net>
To: netfilter@lists.netfilter.org
Subject: Re: how to delete a group of rules (nfcan: addressed to exclusive sender for this address)
Date: Sat, 27 Nov 2004 13:12:50 -0500	[thread overview]
Message-ID: <20041127181250.GA14797@salty> (raw)
In-Reply-To: <200411271718.iARHIeQC018403@gourmet.spamgourmet.com> (from +nfcan+jimlaur+ec99bc9f19.alexis#tpys.com.ar@spamgourmet.com on Sat, Nov 27, 2004 at 12:17:44 -0500)

On 2004.11.27 12:17, Alexis - alexis@tpys.com.ar wrote:
> Hi all, im coding a frontend for iptables based on php and mysql.
> 
> But i have an issue when i try to delete a group of rules, it cant be done.
> 
> suppose this
> 
> a chain called "x1"
> 
> delete the chain implies
> 
> - empty the chain
> - delete all  rules that reference the chain

For what its worth, I would empty the chain
after I deleted the references.

> 
> the first line is easy to do  with iptables -F x1 , but if (as an example)
> in filter::INPUT i have 2 or more references to this chain, executing
> iptables -D INPUT -j x1 will delete only the first one and not all rules
> that references x1.

I believe that any rule can be deleted by specifying the exact parameters
used to create it, that is changing the -A for instance to -D, leaving
the rest of the command unchanged (for example -p tcp, or -d x.x.x.x, etc.).

Surely each rule in a table has a unique pattern, or why would it be there?

This does not, as you say, allow for deletion of a group of related commands,
however, it should let you accomplish what you need to do.

Just delete the rules iteratively, one at a time,
creating the delete commands from those used to add each rule.

I hope that helps.

Jim



           reply	other threads:[~2004-11-27 18:12 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200411271718.iARHIeQC018403@gourmet.spamgourmet.com>]

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=20041127181250.GA14797@salty \
    --to=nfcan.x.jimlaur@dfgh.net \
    --cc=netfilter@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox