Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


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

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
Senior Member
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
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.

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

Rep: Reputation: 377Reputation: 377Reputation: 377Reputation: 377
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.


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
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 > Forums > Linux Forums > Linux - Security

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

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