LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 08-18-2011, 03:52 AM   #1
algernon_z
Member
 
Registered: Apr 2006
Location: Amsterdam
Distribution: Solaris 9, Solaris 10, OpenIndiana, Cisco IOS, RedHat Linux, CentOS
Posts: 34

Rep: Reputation: 0
iptables: accept all dest ports


Good morning,

iptables help needed, since I cant' get this rule right.
It is a variation on this one:

# Accept tcp packets on destination ports 6881-6890
iptables -A INPUT -p tcp --dport 6881:6890 -j ACCEPT


I want to accept packets on ALL tcp destination ports.
Maybe I just think too complicated, but I can't find the right example for it either.
Please advice.

Thanks, Algy
 
Old 08-18-2011, 07:08 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
Using -A will add your rule to the end of the chain.

There must be a matching rule earlier in the chain that causes the packets to be dropped.

You need to either post your INPUT chain, or find the rule that is dropping the packets that you want to keep and use the -I flag to insert the rule above the offending rule.

See
Code:
man iptables
for the syntax.
 
Old 08-18-2011, 09:55 AM   #3
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by algernon_z View Post
I want to accept packets on ALL tcp destination ports.
Then get rid of the --dports match in your rule.

That said, why would you wanna do this? It goes contrary to the intended purpose of a firewall.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
open ports for utorrent using iptables n close smpt to that ports shtorrent00 Linux - Networking 2 09-30-2008 03:34 PM
how? redirect apache2 outbound ports to specific ports w/iptables? nowshining Linux - Security 5 05-27-2008 02:46 AM
accept() not opening new ports. blackhole123 Linux - Networking 2 12-01-2005 05:31 AM
why won't Apache accept and additional Listen ports? mikeghet Linux - Networking 22 11-08-2005 10:06 PM
rh9: configure ports to accept remote connection for azureus bleachie Linux - Software 0 02-16-2004 02:13 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration