LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   iptables: accept all dest ports (https://www.linuxquestions.org/questions/linux-security-4/iptables-accept-all-dest-ports-898014/)

algernon_z 08-18-2011 03:52 AM

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

andrewthomas 08-18-2011 07:08 AM

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.

win32sux 08-18-2011 09:55 AM

Quote:

Originally Posted by algernon_z (Post 4446430)
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.


All times are GMT -5. The time now is 05:33 PM.