LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   iptables delete rule (https://www.linuxquestions.org/questions/linux-newbie-8/iptables-delete-rule-497577/)

Fredde87 11-01-2006 11:03 AM

iptables delete rule
 
Can someone please explain to me why this happens...

Code:

[root@ipg2 /]$iptables -I FORWARD -p TCP -d 123.123.123.13 --dport 543 -j ACCEPT
[root@ipg2 /]$iptables -D FORWARD -p TCP -d 123.123.123.13 --dport 543 -j ACCEPT
iptables: Bad rule (does a matching rule exist in that chain?)

Am I missing something? :S

Mara 11-01-2006 01:19 PM

It works fine here. Please check if the rule is really added at the first place.

Fredde87 11-02-2006 03:07 AM

it is... Thats the weird thing, first I thought it wasnt being added properly but it is. Iptables is very slow though, iptables -L waits exactly 10 seconds between every entry when it is printing it to the screen.

icechong 11-02-2006 03:37 AM

it works fine on my linux box also.

Fredde87 11-02-2006 07:46 AM

I know it should work... Its just on this busybox where I am having trouble. I found a thread with someone who had the same issue but his issue was caused by update iptables without flushing old rules before. But I havent updated it and it wont even delete new rules like the one I posted first.

Fredde87 11-03-2006 04:55 AM

I guess I will have to find someother way to remove the rule. Any tips on the best way of finding which line a rule is on so I can delete it? Problem is iptables replaces the port number with the service name (does it look up the port number in /etc/services ?)

Fredde87 11-03-2006 09:09 AM

I have to go in another direction... What I am now going to do is flush the chain and just run the rules again. There are some standard rules though which comes with this busybox PC that I want to keep though... so I was just wondering what command should I run if I want to add the following rules,

REJECT udp -- anywhere anywhere udp dpts:netbios-ns:netbios-dgm reject-with icmp-port-unreachable
LOG all -- anywhere anywhere limit: avg 10/min burst 5 LOG level warning prefix `DROP INP: '
REJECT tcp -- anywhere anywhere reject-with tcp-reset
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable


All times are GMT -5. The time now is 08:34 AM.