LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-01-2006, 11:03 AM   #1
Fredde87
Member
 
Registered: Aug 2005
Posts: 158

Rep: Reputation: 30
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
 
Old 11-01-2006, 01:19 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,569

Rep: Reputation: 171Reputation: 171
It works fine here. Please check if the rule is really added at the first place.
 
Old 11-02-2006, 03:07 AM   #3
Fredde87
Member
 
Registered: Aug 2005
Posts: 158

Original Poster
Rep: Reputation: 30
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.
 
Old 11-02-2006, 03:37 AM   #4
icechong
Member
 
Registered: Oct 2006
Posts: 42

Rep: Reputation: 15
it works fine on my linux box also.
 
Old 11-02-2006, 07:46 AM   #5
Fredde87
Member
 
Registered: Aug 2005
Posts: 158

Original Poster
Rep: Reputation: 30
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.
 
Old 11-03-2006, 04:55 AM   #6
Fredde87
Member
 
Registered: Aug 2005
Posts: 158

Original Poster
Rep: Reputation: 30
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 ?)
 
Old 11-03-2006, 09:09 AM   #7
Fredde87
Member
 
Registered: Aug 2005
Posts: 158

Original Poster
Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables rule for ftp dcdbutler Linux - Networking 5 10-15-2006 12:12 PM
What is it doing this iptables rule?? lanczer Linux - Security 1 02-24-2006 11:26 AM
help with iptables rule!! vishamr2000 Linux - Security 6 11-09-2005 05:34 AM
iptables rule order Kumado Linux - Security 4 10-13-2005 11:12 PM
IPTables Rule... Grim Reaper Linux - Software 8 04-28-2003 12:20 PM


All times are GMT -5. The time now is 06:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration