Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
-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.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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)

share|improve this answer
    
Fixed it! I added -F INPUT On the line right above it! THanks guys! @poige was on the right track! –  Jeremy Sayers Apr 25 '12 at 16:58

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.

share|improve this answer
    
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 '12 at 15:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.