Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I though I filtered out smtp on port 25 but when I run iptables -L to list active firewall rules, I get the following still in my result:

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:smtp

should't that be removed, I have put the following rule in comments in my shell script, saved and reloaded iptables

# iptables -A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
# iptables -A OUTPUT -p tcp -m tcp --dport 25 -j ACCEPT

UPDATE: the script I have used is here, only difference is that I commented out the port 25 lines

share|improve this question
I think we are going to need more information here. You mention a shell script, does it completely flush all the rules? We may need you to post more of the script, or possibly all of it. – Zoredache Jun 28 '10 at 19:22
I do this at the top: # Wipe the tables clean iptables -F – solsol Jun 28 '10 at 19:26
that's: iptables -F – solsol Jun 28 '10 at 19:27
+1 for posting the entire script (or, if it's long, putting it online and linking to it) – David Z Jun 28 '10 at 20:38
the script is here, only difference is that I commented out the port 25 lines – solsol Jun 29 '10 at 11:51

Just use Centos builtin iptables mechanisms they are better designed that using a script, it flushes rules, loads modules, checks syntax etc.

share|improve this answer
what mechanisms are you talking about then? – solsol Jul 23 '10 at 10:24
The init script and the iptables config file. /etc/sysconfig/iptables-config – topdog Jul 24 '10 at 8:37

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.