Re: deleting specific rule ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux