0
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20000:25000 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20004 -j ACCEPT

Those are my two rules I made in my iptables in an attempt to open up all the ports from 20000:25000 when I realized the first didn't work I tried just an individual port, but still not open, the ports are being used for Minecraft and so with iptables on I can't connect to the servers, with them off, I can connect to the Minecraft servers no problem.

Yes I have been restarting my iptables each time and I'm on CentOS.

2 Answers 2

2

AFAIR, CentOS uses predefined firewall rule set, so you either need to fit just into it, or at least try inserting those rules at the very beginning of the list (iptables -I INPUT 1)

1
  • Fixed it! I added -F INPUT On the line right above it! THanks guys! @poige was on the right track! Apr 25, 2012 at 16:58
1

You need to allow also the following traffic:

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

This is important to allow the traffic coming back as reply. Otherwise, the connection can be fully established. Of course, this is assuming default DROP policy for INPUT.

1
  • Khaled, I think its worth mentioning the method to your madness regarding the use of just NEW vs. NEW, RELATED, and ESTABLISHED
    – dc5553
    Apr 25, 2012 at 15:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .