LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-26-2010, 11:59 AM   #1
myubuntu
LQ Newbie
 
Registered: Feb 2010
Posts: 23
Blog Entries: 2

Rep: Reputation: 15
IP Tables - help


Hi guys, I have added rule to REJECT tcp dport 22 & can you please let me know what rule I have to add to delete that particular "REJECT" rule, so that dport can be allowed. please let me know.
My current rule mentioned below..

Chain INPUT (policy DROP 73 packets, 4764 bytes)
pkts bytes target prot opt in out source destination
2 120 REJECT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 reject-with icmp-port-unreachable
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
49 7874 ACCEPT tcp -- eth0 * 172.16.0.0/16 0.0.0.0/0
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
0 0 ACCEPT tcp -- eth0 * 172.16.0.0/16 0.0.0.0/0
 
Old 03-26-2010, 12:53 PM   #2
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
What is the cmd you use to add the reject?
If you used something like this:
Code:
iptables -A INSERT -p tcp --dport 22 -j REJECT
to reverse/delete it you should use
Code:
iptables -D INSERT -p tcp --dport 22 -j REJECT
As you can see, the commands are almost exactly the same, except the "-A" (append) and "-D" (delete) switches
 
Old 03-26-2010, 01:56 PM   #3
BlackHatRob
Member
 
Registered: Feb 2005
Posts: 36

Rep: Reputation: 15
You can also do a iptables --list --line-numbers
Using this information you can do the following
iptables -D <chain> <line-number>

When you do, dont forget to save your chains
 
  


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
IP Tables Jeewhizz Linux - Security 3 02-26-2009 02:27 PM
IP Tables JKoder Fedora 1 11-08-2006 03:52 AM
IP Tables gjagadish Linux - Networking 1 02-10-2006 06:33 PM
IP Tables gjagadish Linux - Security 1 02-10-2006 12:49 PM
Ip Tables Mag|c Linux - Security 3 06-26-2003 11:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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