* Deleting Rules
@ 2003-09-14 9:00 Paul Caritj
2003-09-14 10:48 ` Chris Brenton
2003-09-14 13:10 ` Sebastian
0 siblings, 2 replies; 3+ messages in thread
From: Paul Caritj @ 2003-09-14 9:00 UTC (permalink / raw)
To: netfilter
Simple Question:
Is it possible to delete rules without complete knowledge of its
contents? E.g., Would it be possible to delete all rules that match a
source ip of X?
If not, can anyone reccomend a workaround? I am creating rules on the
fly and setting them to mark packets with a flag that would not be
knowable subsequently. (Rather, unknowable unless there is no solution
to this problem and I am forced to keep some sort of log...eew)
Thanks,
Paul
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Deleting Rules
2003-09-14 9:00 Deleting Rules Paul Caritj
@ 2003-09-14 10:48 ` Chris Brenton
2003-09-14 13:10 ` Sebastian
1 sibling, 0 replies; 3+ messages in thread
From: Chris Brenton @ 2003-09-14 10:48 UTC (permalink / raw)
To: Paul Caritj; +Cc: netfilter
Paul Caritj wrote:
>
> Is it possible to delete rules without complete knowledge of its
> contents? E.g., Would it be possible to delete all rules that match a
> source ip of X?
Not in my experience. Its only worked for me when I specify all the same
options that are in the original rule.
> If not, can anyone recommend a workaround?
Maybe you can grep the output from '-L -nv' to search for the IP address
you want, and then use info in the output to create your delete rule?
HTH,
C
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Deleting Rules
2003-09-14 9:00 Deleting Rules Paul Caritj
2003-09-14 10:48 ` Chris Brenton
@ 2003-09-14 13:10 ` Sebastian
1 sibling, 0 replies; 3+ messages in thread
From: Sebastian @ 2003-09-14 13:10 UTC (permalink / raw)
To: 'Paul Caritj', Netfilter Mailinglist
Hi
Try around with something like this:
iptables -L INPUT -n --line-numbers | \
awk -- '{ if ($5=="192.168.0.1") { iptables -D INPUT $1 } }'
This will delete all entries in INPUT chain with source IP (column 5) of
192.168.0.1
Pearhaps you have to optimize some things to fit your needs.
Greets
Sebastian.
> -----Original Message-----
> From: netfilter-admin@lists.netfilter.org
> [mailto:netfilter-admin@lists.netfilter.org] On Behalf Of Paul Caritj
> Sent: Sunday, September 14, 2003 11:00 AM
> To: netfilter@lists.netfilter.org
> Subject: Deleting Rules
>
>
> Simple Question:
>
> Is it possible to delete rules without complete knowledge of its
> contents? E.g., Would it be possible to delete all rules that match a
> source ip of X?
>
> If not, can anyone reccomend a workaround? I am creating rules on the
> fly and setting them to mark packets with a flag that would not be
> knowable subsequently. (Rather, unknowable unless there is no
> solution
> to this problem and I am forced to keep some sort of log...eew)
>
>
> Thanks,
> Paul
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-09-14 13:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-14 9:00 Deleting Rules Paul Caritj
2003-09-14 10:48 ` Chris Brenton
2003-09-14 13:10 ` Sebastian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox