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

After installing Centos 5.8 I could not pick up any open ports using nmap. So I ran the command #iptables --flush and all started working. However, after about 2 days I could not connect again and had to run the command.

1)How can I permanently ensure that my ports are open

2)What could be causing them to be shut in the first place since I did not touch the iptables?

share|improve this question
up vote 4 down vote accepted

Configure the firewall to open only the ports that you need to have open. Disabling the firewall entirely is very dangerous. You can use the system-config-firewall-tui command to configure it from a terminal.

share|improve this answer
This is definitely a smart answer. Never disable the firewall if you value the internet at large. Even if you have no assets on your machine you will still open the door for attackers to use your box in a botnet or as a spam agent. – gillytech Jun 23 '14 at 4:41

I think you're running into the default firewall. Try these:

service iptables stop
chkconfig iptables off
share|improve this answer

The easiest way is to disable iptables:

service iptables save
service iptables stop
chkconfig iptables off

and for IPv6

service ip6tables save
service ip6tables stop
chkconfig ip6tables off
share|improve this answer

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.