Linux Netfilter discussions
 help / color / mirror / Atom feed
* Re: how to delete a group of rules (nfcan: addressed to exclusive sender for this address)
       [not found] <200411271718.iARHIeQC018403@gourmet.spamgourmet.com>
@ 2004-11-27 18:12 ` Jim Laurino
  0 siblings, 0 replies; only message in thread
From: Jim Laurino @ 2004-11-27 18:12 UTC (permalink / raw)
  To: netfilter

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-27 18:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200411271718.iARHIeQC018403@gourmet.spamgourmet.com>
2004-11-27 18:12 ` how to delete a group of rules (nfcan: addressed to exclusive sender for this address) Jim Laurino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox