netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: deleting specific rule ...
Date: Mon, 14 Jun 2004 16:25:19 +0100	[thread overview]
Message-ID: <200406141625.19755.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <20040614150414.GA26186@legolas.on.net.mk>

On Monday 14 June 2004 4:04 pm, Damjan wrote:

> > > here is the list of rule in my iptables
> > >
> > > now i want to delete this rule ..
> > >
> > > wat will be the command in doing so ?
> >
> > 	Hi -- relist the rules
> >
> > 	iptables -L -n --line-numbers
> >
> > 	will number each line.
> >
> > 	iptables -D INPUT x
>
> Unfourtenatelly there's a chance that between those two commands the
> line-number of the required rule could change.

I don't quite understand why (although I agree that it's remotely possible), 
so how about using -D instead of -A (or -I) with exactly the same parameters 
as you specified when adding the rule?

eg: if you add a rule using

iptables -A FORWARD -p tcp --dport 80 -s 10.20.30.40 -d 172.16.17.18 -j REJECT

you can delete it using

iptables -D FORWARD -p tcp --dport 80 -s 10.20.30.40 -d 172.16.17.18 -j REJECT

Where it happens to be in the ruleset when you delete it is irrelevant.

Regards,

Antony.

-- 
People who use Microsoft software should be certified.

                                                     Please reply to the list;
                                                           please don't CC me.



  reply	other threads:[~2004-06-14 15:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-11 16:00 spyware Luis GUSTAVO
2004-06-11 20:13 ` deleting specific rule Syed Faisal Gillani
2004-06-11 22:15   ` Alistair Tonner
2004-06-14 15:04     ` Damjan
2004-06-14 15:25       ` Antony Stone [this message]
2004-06-14 15:58         ` Damjan

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=200406141625.19755.Antony@Soft-Solutions.co.uk \
    --to=antony@soft-solutions.co.uk \
    --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;
as well as URLs for NNTP newsgroup(s).