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 atempt to open up all the ports from 20000:25000 when I realized the first didnt work I tried just an individual port, but still not open, the ports are being used for minecraft and so with iptables on I cant 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, Thanks!

share|improve this question
add comment

2 Answers

up vote 1 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
add comment

You need to allow also the following traffic:


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
add comment

Your Answer


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.